AWS CodeBuild 运行成功,但不会将构建移动到 S3。它应该从 Github 下载我的代码,运行一些命令,然后将所有文件的 ZIP 推送到 S3。
我在 github 中的buildspec.yml:
version: 0.1
phases:
pre_build:
commands:
- echo Pre-build started on `date`
- cp envs/.env.test .env
- composer self-update
- composer install --no-interaction
artifacts:
files:
- '**/*'
Run Code Online (Sandbox Code Playgroud)
以下是显示未指定工件文件的日志:
[Container] 2017/04/18 16:33:59 Phase is DOWNLOAD_SOURCE
[Container] 2017/04/18 16:33:59 Source is located at /tmp/src930293331/src
[Container] 2017/04/18 16:33:59 YAML location is /tmp/src930293331/src/buildspec.yml
[Container] 2017/04/18 16:33:59 Registering with agent
[Container] 2017/04/18 16:33:59 Phases found in YAML: 2
[Container] 2017/04/18 …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 AWS Pipeline、S3 和 CodeBuild 为 Angular 2 应用程序设置自动部署。
按照 Andrés 的教程,我能够将 CodeBuild 连接到 GitHub 存储库,并且该过程运行良好。
然而,我们的 Angular 应用程序位于更大的 repo 的子目录中。
有没有办法在 repo 中指定一个目录,以便只有在子目录更改时才会触发构建?
非常感谢。
我试图在AWS Codebuild构建期间将一些环境变量设置为构建步骤的一部分。尚未设置变量,以下是一些日志:
[Container] 2018/06/05 17:54:16 Running command export TRAVIS_BRANCH=master
[Container] 2018/06/05 17:54:16 Running command export TRAVIS_COMMIT=$(git rev-parse HEAD)
[Container] 2018/06/05 17:54:17 Running command echo $TRAVIS_COMMIT
[Container] 2018/06/05 17:54:17 Running command echo $TRAVIS_BRANCH
[Container] 2018/06/05 17:54:17 Running command TRAVIS_COMMIT=$(git rev-parse HEAD)
[Container] 2018/06/05 17:54:17 Running command echo $TRAVIS_COMMIT
[Container] 2018/06/05 17:54:17 Running command exit
[Container] 2018/06/05 17:54:17 Running command echo Installing semantic-release...
Installing semantic-release...
Run Code Online (Sandbox Code Playgroud)
因此,您会注意到,无论我如何设置变量,当我回显它时,它总是空的。
以上是使用此buildspec制作的
version: 0.1
# REQUIRED ENVIRONMENT VARIABLES
# AWS_KEY - AWS Access Key ID
# AWS_SEC …Run Code Online (Sandbox Code Playgroud) 有没有人在 DOWNLOAD_SOURCE 步骤中遇到 AWS CodeBuild 的此失败消息,可以提供有关如何解决此错误的一些见解?
Message authentication required for primary source and source version
我们使用 AWS CodeBuild Branch 过滤器选项仅在执行 PUSH to Master 时触发构建。但是,最近显然删除了“分支过滤器”选项,并添加了“Webhook 事件过滤器组”。他们应该提供我期望的更多功能,但我看不到如何制作“分支过滤器”。
有人可以帮忙吗?
我一直在浪费很多时间来尝试使用 CloudFormation 设置 GitHub 网络挂钩。此过程的文档无用,例如:https : //docs.aws.amazon.com/codebuild/latest/userguide/sample-access-tokens.html
$ aws codebuild import-source-credentials --generate-cli-skeleton
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:
aws help
aws <command> help
aws <command> <subcommand> help
aws: error: argument operation: Invalid choice, valid choices are:
batch-delete-builds | batch-get-builds
batch-get-projects | create-project
create-webhook | delete-project
delete-webhook | invalidate-project-cache
list-builds | list-builds-for-project
list-curated-environment-images | list-projects
start-build | stop-build
update-project | help
Run Code Online (Sandbox Code Playgroud)
我的问题是我找不到为带有 CloudFormation 的 CodeBuild 指定 GitHub 访问令牌的方法。我只是想为 github 存储库设置一个网络钩子,以便在创建、更新拉取请求等时运行一个简单的测试套件。 如前所述,我发现了很多半生不熟的文档,如 …
我们有2份报告
在 Repo 1 > package.json 中有一个依赖项
"dependencies": {
"repo-2": "git+https://git-codecommit.us-east-1.amazonaws.com/v1/repos/repo-2/"
}
Run Code Online (Sandbox Code Playgroud)
然后,在“repo-1”的 CodeBuild 中,我们有以下构建规范
version: 0.2
phases:
install:
runtime-versions:
nodejs: 10
commands:
- mkdir -p ./deploy
build:
commands:
- echo "Server copy START $(date)"
- cp -r ./index.js ./deploy/index.js
- cp -r ./package.json ./deploy/package.json
- cp -r ./buildspec.yml ./deploy/buildspec.yml
- echo "Server copy END $(date)"
- echo "Server npm install START $(date)"
- cd ./deploy && npm install --production
- echo "Server npm install END …Run Code Online (Sandbox Code Playgroud) 当我收到来自 github 的推送事件时,我试图在我的代码构建脚本中读取提交消息。我的主要目标是使用skip ci包含 travis 或其他 ci 工具的消息跳过构建。
git show -s --format=%s(或git show任何选项)导致:
error: Could not read <previous SHA here>
fatal: unable to parse commit <previous SHA here>
Run Code Online (Sandbox Code Playgroud)
git log -1 --pretty=%s 也会导致错误。
我曾经git rev-parse --is-shallow-repository看到它是一个浅层存储库,我尝试使用git fetch --unshallow但导致此消息:
error in object: unshallow <SHA from a couple months ago>.
我知道的一些 git 命令确实有效
有谁知道如何从代码构建中的推送事件中读取提交消息?
我还要注意Source Versionaws 控制台中的提交 SHA。当我手动点击开始建设,并提供一个分支名 …
我是 Kubernetes 的新手,正在尝试创建一个 AWS CodePipeline 来将服务部署到 EKS 堆栈。
我正在关注本教程 我已遵循所有步骤,包括创建角色和添加权限,以便CodeBuild能够与 EKS 对话。
我现在面临的问题是当 CodePipeline 运行时,它在CodeBuild阶段执行以下命令失败。
kubectl apply -f hello-k8s.yml
并给出这个错误
[Container] 2019/12/04 07:41:43 Running command kubectl apply -f hello-k8s.yml
unable to recognize "hello-k8s.yml": Unauthorized
unable to recognize "hello-k8s.yml": Unauthorized
Run Code Online (Sandbox Code Playgroud)
我不太确定这是否是凭据问题,因为我已经按照教程使用了所有步骤来添加用户/角色。
任何人都可以帮我解决这个问题吗?
amazon-web-services kubernetes aws-codepipeline kubectl aws-codebuild
我在 CodeBuild 构建过程的 BUILD 阶段收到以下错误:
“执行命令时出错:docker build -t ...”原因:退出状态1
我有一个设置了 ecr 权限的代码构建服务角色,aws ecr 登录阶段已经成功,我的 buildspec.yml 非常简单 - 几乎只是标准模板。运行时是 Amazon 管理的 ubuntu 映像,标准。
是否有任何原因为什么 Docker 构建可能会失败以及任何人建议进行故障排除?
谢谢
完整的 buildspec.yml 文件:
version: 0.2
phases:
pre_build:
commands:
- echo Logging in to Amazon ECR...
- $(aws ecr get-login --no-include-email --region eu-west-1)
build:
commands:
- echo Building the Docker image...
- docker build -t maxmind:latest .
- docker tag maxmind:latest 381475286792.dkr.ecr.eu-west-1.amazonaws.com/maxmind:latest
post_build:
commands:
- echo Build completed on `date`
- echo Pushing the Docker …Run Code Online (Sandbox Code Playgroud) aws-codebuild ×10
amazon-s3 ×2
github ×2
bash ×1
composer-php ×1
docker ×1
kubectl ×1
kubernetes ×1
ubuntu-14.04 ×1
xcodebuild ×1