AWS CodePipeline Doesn't upload artifacts to AWS S3

扶醉桌前 提交于 2019-12-14 03:42:03

问题


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

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

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


回答1:


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"
    }
]

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

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.

Get the pipleline details:

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

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



回答2:


I had this same problem, couldn't see the MyAppBuild folder in S3 that was meant to hold CodeBuild artifacts. Logged out of the web console and back in again and the folder was now visible.



来源:https://stackoverflow.com/questions/49291962/aws-codepipeline-doesnt-upload-artifacts-to-aws-s3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!