【发布时间】:2020-01-25 19:08:54
【问题描述】:
我正在配置 CICD piepline 使用 aws 服务代码构建 pilepileline 等,以更新我的 ecs fargate 集群中的 deploymnet,在我的 buildspec.yml 文件中,aws ecs cli 命令失败并抛出“COMMAND_EXECUTION_ERROR:执行命令时出错:aws ecs update- service --services xxxxx。原因:退出状态 255"
我已尝试使用“AmazonECS_FullAccess”策略为 codebuild 角色提供权限。
post_build:
commands:
- echo Build completed on `date`
- echo Pushing the Docker images...
- docker push $REPOSITORY_URI:latest
- docker push $REPOSITORY_URI:$IMAGE_TAG
- echo Writing image definitions file...
- printf '[{"name":"xxxxxxx","imageUri":"%s"}]' $REPOSITORY_URI:$IMAGE_TAG > imagedefinitions.json
- cat imagedefinitions.json
- echo Updating ECSfargate service ...
- aws ecs describe-services --services xxxxxxxxxxxxxxxxx
- aws ecs update-service --service xxxxxxxxxxxxxxxxx --desired-count 2 --no-force-new-deployment
【问题讨论】:
标签: amazon-web-services amazon-iam amazon-ecs aws-codebuild