Jenkins upload to S3 (Post build Action)

This is my directory path in jenkins /var/jenkins_home/workspace/automation.

1.) I am trying to upload the contents in the automation folder to my S3 bucket. When I set the source and destination, I could only upload files but not the folders inside my automation directory.

2.) When I upload all the files are stored in S3Bucket/jobs/automation/BUILD-NUMBER/MY-FILES. Whereas I need my files in the S3Bucket root.

Upvotes: 0

Views: 8058

Answers (3)

Pratztr
Pratztr

Reputation: 57

You can use 'Flatten Directories' in case you don't want the directory structure in your S3 bucket.

Upvotes: 0

Mor Lajb
Mor Lajb

Reputation: 2636

you can use the aws S3 cp from bash command -

http://docs.aws.amazon.com/cli/latest/reference/s3/

PLS make sure to install the aws cli on the slave that runs the job

Mor

Upvotes: 1

Jimilian
Jimilian

Reputation: 3919

To void this problem you need to uncheck "Manage artifacts" in S3 Plugin upload options. In this case files will be uploaded directly to bucket root.

Upvotes: 2

Related Questions