[英]AWS CodeBuild batch build - access artifacts
I've set up a build job that uses batch builds.我已经设置了一个使用批量构建的构建作业。
2 batches will build something, upload to S3 and output the location in a json file. 2 批将构建一些东西,上传到 S3 和 output json 文件中的位置。
The last batch is supposed to pick up the two json files and use them in some further things.最后一批应该获取两个 json 文件并将它们用于其他一些事情。
My problem: I can't find the artifacts in the last job.我的问题:我在上一份工作中找不到工件。
When I use ls in the first 2 jobs, they are there - but not in the last one.当我在前两个作业中使用 ls 时,它们就在那里——但在最后一个作业中没有。
Here is my buildspec, with unimportantt parts removed.这是我的构建规范,删除了不重要的部分。
version: 0.2
batch:
fast-fail: true
build-graph:
- identifier: template_examplehook
- identifier: s3_checkbucketencryptionhook
- identifier: stackset
buildspec: automation/assemble-template.yaml
depend-on:
- template_examplehook
- s3_checkbucketencryptionhook
phases:
install:
runtime-versions:
python: 3.7
pre_build:
commands:
- echo "Starting ..."
- ...
build:
commands:
- echo "Building with $(python --version)"
- cd $CODEBUILD_BATCH_BUILD_IDENTIFIER
- ---
- echo $S3_URI_PACKAGE > hash.json
- ---
post_build:
commands:
- echo Build completed on $(date)
artifacts:
files:
- '*/hash.json'
I expected to find the hash.json file in their respective folders but they don't exist in the last batch job.我希望在各自的文件夹中找到 hash.json 文件,但它们在上一个批处理作业中不存在。
Update after talking to our AWS tech support:与我们的 AWS 技术支持交谈后更新:
Unexpected behaviors, it should work as we thought it would, but it doesn't.意外的行为,它应该像我们想象的那样工作,但它没有。
We ended up rewriting it and went with two different build steps.我们最终重写了它并采用了两个不同的构建步骤。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.