AWS CodePipeline不会将工件上传到AWS S3 [英] AWS CodePipeline Doesn't upload artifacts to AWS S3

查看:157
本文介绍了AWS CodePipeline不会将工件上传到AWS S3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了使(Android)构建和测试过程自动化,我配置了 AWS代码管道,该管道将首先从 GitHub 获取代码并触发构建(通过 aws codebuild ),构建显示为成功完成,但是由于构建过程而生成的工件(apk文件)没有上载到s3存储桶(公共存储桶).日志清楚地表明上传成功,如所附的屏幕截图所示.

As an effort to automate the (Android) build and test process, I configured an AWS code pipeline that will 1st get the code from GitHub and trigger a build (via aws codebuild) Build is shown as completed successfully but the artifacts (apk file) generated as a result of the build process isn't uploaded to the s3 bucket (public bucket). The logs clearly say the upload is successful as seen in the screenshots attached The codepipeline as well shows everything is successful as attached

但是,如果我直接从AWS Codebuild屏幕运行 aws codebuild项目,它会成功将工件上传到s3存储桶!

However, if I run aws codebuild project directly from the aws codebuild screen, it does upload the artifact successfully to the s3 bucket!

我尝试将存储桶权限更改为public/non public,等等.到目前为止没有成功

I tried changing the bucket permissions to public/non public, etc. So far no success

推荐答案

CodePipeline将覆盖CodeBuild的工件存储桶,我想它会将工件移到了自己的存储桶中.您可以通过运行以下命令来查看CodePipeline的存储桶.

CodePipeline will override the CodeBuild's artifact bucket, I guess it's moving the artifacts to its own Bucket. you can see the CodePipeline's bucket by running the below command.

codepipeline get-pipeline --name PipelineName--query pipeline.[artifactStore]

[
    {
        "type": "S3",
        "location": "codepipeline-us-east-1-xxxxxxxx"
    }
]

如果您正在使用CloudFormation创建管道,则可以使用

If you are using CloudFormation to create the pipeline you configure the bucket using ArtifactStore.

更新CodePipeline中的ArtifactStore: 目前,我没有找到通过控制台更新ArtifactStore的方法,但是可以通过update-pipeline命令来完成.

Update ArtifactStore in CodePipeline: Currently, I don't see a way to update the ArtifactStore through Console but it can be done with update-pipeline command.

获取pipleline详细信息:

Get the pipleline details:

aws codepipeline get-pipeline --name MyFirstPipeline >pipeline.json

编辑管道以更新artifactStore中的S3存储桶,然后运行命令.

Edit the pipeline to update the S3 Bucket in artifactStore and then run the command.

aws codepipeline update-pipeline --cli-input-json file://pipeline.json

这篇关于AWS CodePipeline不会将工件上传到AWS S3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆