我对 AWS CodeBuild 有一个令人困惑的问题。我收到以下错误:
Major version of alias '14.x' is not supported in runtime 'nodejs'
Run Code Online (Sandbox Code Playgroud)
当我将构建规范更新为“14”时,我得到了有关错误的更多信息:
Message: Unknown runtime version named '14' of nodejs. This build image has the following versions: 10, 12
Run Code Online (Sandbox Code Playgroud)
我们已经使用这个 CodeBuild 项目很长时间了,使用的是 12.x,现在需要更新到 14.x。我们更新了构建规范如下:
version: 0.2
phases:
install:
runtime-versions:
nodejs: 14.x
build:
commands:
- "npm i"
- "npm run build"
- "npm run db:migrate"
artifacts:
files:
- "all"
- "of"
- "our"
- "files"
Run Code Online (Sandbox Code Playgroud)
此外,我们的 CodeBuild 已采用最新版本的 CodeBuild 映像。我什至重新构建了 CodeBuild 项目,以确保它是最新的并且仍然存在相同的问题:
aws/codebuild/amazonlinux2-x86_64-standard:3.0
预先感谢您的任何建议。
master
在使用Github
作为源提供程序时,如何在AWS代码部署上指定不同的分支而不是分支?我看到没有选项可以在控制台中选择分支(可能是我错过了).
当我们处于pre_build
阶段时,我试图结帐到不同的分支,但它在下载源阶段本身失败,因为master
分支没有YAML文件.
version: 0.1
phases:
install:
commands:
- apt-get update -y
pre_build:
commands:
- git checkout testbranch
Run Code Online (Sandbox Code Playgroud) 由于以下错误,CodeBuild 项目在配置阶段失败
BUILD_CONTAINER_UNABLE_TO_PULL_IMAGE: Unable to pull customer's container image. CannotPullContainerError: Error response from daemon: pull access denied for <image-name>, repository does not exist or may require 'docker login': denied: User: arn:aws:sts::<id>
Run Code Online (Sandbox Code Playgroud)
导入错误:无法从“botocore.docs.bcdoc”
(/python3.7/site-packages/botocore/docs/bcdoc/ init .py)导入名称“docevents”
Traceback (most recent call last):
File "/root/.pyenv/versions/3.7.6/bin/aws", line 19, in <module>
import awscli.clidriver
File "/root/.pyenv/versions/3.7.6/lib/python3.7/site-packages/awscli/clidriver.py", line 36, in <module>
from awscli.help import ProviderHelpCommand
File "/root/.pyenv/versions/3.7.6/lib/python3.7/site-packages/awscli/help.py", line 23, in <module>
from botocore.docs.bcdoc import docevents
ImportError: cannot import name 'docevents' from 'botocore.docs.bcdoc' (/root/.pyenv/versions/3.7.6/lib/python3.7/site-packages/botocore/docs/bcdoc/__init__.py)
[Container] 2020/10/29 16:48:39 Command did not exit successfully aws --version exit status 1
Run Code Online (Sandbox Code Playgroud)
失败发生在PRE_BUILD 中。
这是我的规范构建文件:buildspec-cd.yml
pre_build:
commands:
- AWS_REGION=${AWS_DEFAULT_REGION}
- COMMIT_HASH=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7)
- IMAGE_VERSION=${COMMIT_HASH}
- REPOSITORY_URI=${CONTAINER_REGISTRY}/${APPLICATION_NAME}
- …
Run Code Online (Sandbox Code Playgroud) 我正在使用git,codebuild和elastic beanstalk构建CI/CD管道.
在代码构建执行期间,当构建由于测试用例的语法错误而失败时,我看到代码构建进展到下一阶段并且最终继续产生工件.
我的理解是如果构建失败,执行应该停止.这是正确的行为吗?
请参阅下面的buildspec.
version: 0.2
phases:
install:
commands:
- echo Installing package.json..
- npm install
- echo Installing Mocha...
- npm install -g mocha
pre_build:
commands:
- echo Installing source NPM placeholder dependencies...
build:
commands:
- echo Build started on `date`
- echo Compiling the Node.js code
- mocha modules/**/tests/*.js
post_build:
commands:
- echo Build completed on `date`
artifacts:
files:
- modules/*
- node_modules/*
- package.json
- config/*
- server.js
Run Code Online (Sandbox Code Playgroud) 当我想使用 CodeBuild 从 CodeCommit 中的 Dockerfile 构建映像时,为什么会发生这种情况?
我收到此错误:
tomanyrequests:您已达到拉取率限制。您可以通过身份验证和升级来增加限制:https : //www.docker.com/increase-rate-limit
amazon-web-services docker dockerfile docker-compose aws-codebuild
我是 AWS 的新手,我正在尝试使用我的免费套餐帐户使用 AWS CodeBuild 构建我的 nodeJS 项目,但收到此错误:
- 构建无法启动 构建无法启动。发生以下错误:该帐户的队列中不能有超过 0 个构建
我遵循简单的 aws 教程,保留所有默认设置,让 aws 为我创建所有服务、图像等。我还将源代码存储在 AwsCodeCommit 存储库中。有人可以帮助我吗?
从 AWS Codebuild 通过 buildspec.yml 执行 npm install -g serverless 时,我看到以下错误
storage-engine@3.0.7 postinstall /usr/local/lib/node_modules/serverless/node_modules/storage-engine node ./compatibility/detect.js
错误:EACCES:权限被拒绝,打开“/usr/local/lib/node_modules/serverless/node_modules/storage-engine/lib/compatibility/index.js”
我使用AWS CodeBuild使用pytest为我的python项目运行单元测试.我使用--junitxml参数和pytest-cov包生成我在buildspec.yml中列为工件的测试报告和覆盖率报告.
我过去曾使用Jenkins来做这件事,Jenkins提供了一些很好的图表和表格,显示了测试结果历史和覆盖历史以及最近测试的结果.
有没有一种很好的方法来查看我的CodeBuild项目生成的报告?我没有直接在CodeBuild或CodePipeline中找到任何内容.我是否必须使用可以提取报告文件的单独工具?如果是这样,那么有什么工具呢?
reporting unit-testing code-coverage aws-codepipeline aws-codebuild
我正在尝试使用docker-compose在AWS CodeBuild上设置自动Rails测试,但是它出错了.
在buildspec.yml中:
phases:
build:
commands:
- docker-compose up -d
[Container] 2018/10/23 11:27:56 Running command docker-compose up -d
Couldn't connect to Docker daemon at http+docker://localhost - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
[Container] 2018/10/23 11:27:56 Command did not exit successfully docker-compose up -d exit status 1
[Container] 2018/10/23 11:27:56 Running command echo This always runs even if the install command fails
This always runs even if the install command …
Run Code Online (Sandbox Code Playgroud) ruby-on-rails amazon-web-services docker docker-compose aws-codebuild
aws-codebuild ×10
docker ×3
amazon-ecr ×1
build ×1
dockerfile ×1
git ×1
python ×1
reporting ×1
unit-testing ×1