[英]aws code build, code deploy, CI/CD pipeline error
构建规范.yml
version: 0.1
environment_variables:
plaintext:
S3_BUCKET: "test"
phases:
install:
commands:
- echo Installing source NPM dependencies...
- npm install
- npm install -g @angular/cli
build:
commands:
- echo Build started on `date`
- ng build --prod -c=staging --output-hashing all
post_build:
commands:
- aws s3 rm s3://${S3_BUCKET} --recursive
- aws s3 cp dist s3://${S3_BUCKET} --recursive
- echo Build completed on `date`
artifacts:
files:
- '**/*'
base-directory: 'dist*'
discard-paths: yes
错误:cloudwatch 日志
pyenv:未安装版本“2.7.15”(由/codebuild/output/src298161583/src/.python-version 设置)
2020-07-06T19:33:12.830-04:00
2020-07-06T19:33:12.830-04:00 [容器] 2020/07/06 23:33:12 命令没有成功退出 aws s3 rm s3://${S3_BUCKET} --recursive exit status 1
您可以尝试升级到buildspec 版本 0.2吗? 例如
version: 0.2
env:
variables:
S3_BUCKET: "test"
phases:
install:
runtime-versions:
python: 3.8
commands:
- echo Installing source NPM dependencies...
- npm install
- npm install -g @angular/cli
build:
commands:
- echo Build started on `date`
- ng build --prod -c=staging --output-hashing all
post_build:
commands:
- aws s3 rm s3://${S3_BUCKET} --recursive
- aws s3 cp dist s3://${S3_BUCKET} --recursive
- echo Build completed on `date`
artifacts:
files:
- '**/*'
base-directory: 'dist*'
discard-paths: yes
基于output
pyenv:未安装版本“2.7.15”(由/codebuild/output/src298161583/src/.python-version 设置)
似乎有些东西正在请求 Python 运行时。 在其中一条评论中,您提到使用了 CodeBuild Docker 映像Ubuntu 18.04 aws/code-build/standard:4.0
。 遗憾的是,此映像仅支持Python 版本 3.7 和 3.8 (而不是版本 2.x),因此在上面更新的构建规范中在运行时版本中添加了python: 3.8
。 因此,仍然存在您必须解决的错误并非不可能。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.