gpt4 book ai didi

amazon-web-services - YAML_FILE_ERROR 消息 : batch yaml definition is required

转载 作者:行者123 更新时间:2023-12-05 01:58:42 27 4
gpt4 key购买 nike

我正在实现代码构建项目,但收到错误 YAML_FILE_ERROR 消息:需要批处理 yaml 定义。到处搜索,但一无所获。

完整错误:

[Container] 2021/07/13 17:09:46 Waiting for agent ping
[Container] 2021/07/13 17:09:49 Waiting for DOWNLOAD_SOURCE
[Container] 2021/07/13 17:09:56 Phase is DOWNLOAD_SOURCE
[Container] 2021/07/13 17:09:56 CODEBUILD_SRC_DIR=/codebuild/output/src805371762/src/git-codecommit.us-east-1.amazonaws.com/v1/repos/test_repo
[Container] 2021/07/13 17:09:56 YAML location is /codebuild/output/src805371762/src/git-codecommit.us-east-1.amazonaws.com/v1/repos/test_repo/buildspec.yaml
[Container] 2021/07/13 17:09:56 Phase complete: DOWNLOAD_SOURCE State: FAILED
[Container] 2021/07/13 17:09:56 Phase context status code: YAML_FILE_ERROR Message: batch yaml definition is required

这是我的 buildspec.yaml(我什至放了这个“批处理”属性,但出现了同样的错误。

version: 0.2

batch:
fast-fail: false

phases:
pre_build:
commands:
- echo Logging in to Amazon ECR...
- $(aws ecr get-login --no-include-email --region us-east-1)
build:
commands:
- echo Build started on `date`
- echo Set script permissions...
- chmod a+x docker-entrypoint.sh
- chmod a+x docker-entrypoint.d/*
- echo Building the Docker image...
- docker image build -f $DOCKER_FILE -t $IMAGE_REPO_NAME .
- docker image tag $IMAGE_REPO_NAME $AWS_ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/$IMAGE_REPO_NAME:$IMAGE_TAG
post_build:
commands:
- echo Build completed on `date`
- echo Pushing the Docker image...
- docker image push $AWS_ACCOUNT_ID.dkr.ecr.us-east-1.amazonaws.com/$IMAGE_REPO_NAME:$IMAGE_TAG
- echo Writing ECSForceNewDeployment definition file...
- cat ecs-force-deploy.json > ECSForceNewDeployment.json
artifacts:
files: ECSForceNewDeployment.json

感谢所有的帮助。

最佳答案

检查您的代码构建项目配置,并确保它具有将“构建类型”设置为“单一构建”而不是“批量构建”的 CodeBuild 操作。

如果您需要它作为“批量构建”,那么您必须在构建规范中正确配置它。但是我从问题中了解到情况并非如此。

要编辑它,请转到您的管道 -> 编辑 -> 编辑阶段(构建)-> 然后单击 AwsCodeBuild 操作卡中的编辑图标:

option screen capture

如果您通过 CDK,请确保 CodeBuildAction 将此属性设置为 false:

执行批量构建:假

(这是默认值,但我这样写是为了避免混淆。)

关于amazon-web-services - YAML_FILE_ERROR 消息 : batch yaml definition is required,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68366937/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com