awslabs / aws-codebuild-jenkins-plugin

AWS CodeBuild integration as a Jenkins build step.
https://aws.amazon.com/codebuild
Apache License 2.0
149 stars 122 forks source link

Duplicating prefix when uploading artifact to S3 #49

Closed cmackenzie1 closed 7 years ago

cmackenzie1 commented 7 years ago

The key prefix is duplicated during the upload to s3 when using Jenkins source.

Current behavior: bucket-name/prefix/key.zip will become bucket-name/prefix/prefix/key.zip Expected behavior: bucket-name/prefix/key.zip will be the same

Log showing the issue (line2)

[AWS CodeBuild Plugin] Using given AWS access and secret key for authorization
[AWS CodeBuild Plugin] Uploading code to S3 at location BUCKET-NAME/commit/commit/project.zip. MD5 checksum is Zi45XEEGcYf7/KN1cp6FTw==
[AWS CodeBuild Plugin] S3 object version id for uploaded source is EaWW4Y9n1hB1FzXDwR.rii3BxO9oErxi
[AWS CodeBuild Plugin] Starting build with 
    > project name [projectname]
    > source version: EaWW4Y9n1hB1FzXDwR.rii3BxO9oErxi
[AWS CodeBuild Plugin] Build Id: projectname:231b085b-af9f-43ed-87f1-cf9b56b73362
[AWS CodeBuild Plugin] Logs url: https://console.aws.amazon.com/cloudwatch/home?region=us-west-2#logEvent:group=/aws/codebuild/projectname;stream=231b085b-af9f-43ed-87f1-cf9b56b73362
[AWS CodeBuild Plugin] Build projectname:231b085b-af9f-43ed-87f1-cf9b56b73362 failed
    > Access Denied (status code: CLIENT_ERROR)
Build step 'AWS CodeBuild' changed build result to FAILURE
leoherran-aws commented 7 years ago

Thanks for bringing this to our attention. We'll work on a fix as soon as we can.

leoherran-aws commented 7 years ago

Fixed by 0ee8f9441e5141846875c07d4fb55832fa6fe099. Thank you for pointing this out. We'll release this fix in the next version of the plugin, but in the meantime you can rebuild it locally.