Published August 04, 2018 by

Upload Build to AWS S3 from Jenkins


If you are using Jenkins as your build server, you can easily and automatically upload your builds from Jenkins to AWS S3.

After doing a one-time configuration on your Jenkins server, syncing your builds to S3 is as easy as running a build.
There is no need to run anything in addition to running a build.

1. Create a new bucket for Jenkins in AWS S3



2. Install S3 Plugin in Jenkins

    Now go to Dashboard -> Manage Jenkins -> Manage Plugins and select        
    Available tab. Find "S3 plugin" and install it.



3. Go to Manage Jenkins and select Configure System. look for Amazon S3 Profiles


   
   Click on Add button for add S3 profile.

4. Please provide a profile name, access key and secret access key for your AWS account. also, Create an IAM user with the relevant S3 Permissions.


    Click on Save button.

5. Configure in Jenkins Job
    Go to Jenkins job and find Post Build Actions and add a new Post Build Action and select Publish Artifacts to S3 Bucket.



6. Configure your S3 Profile and define the files to upload.
  
     Click on Save button.

Now each time you run a (successful) build, your artifacts will automatically upload to your S3 bucket.

7. Click Build Now
8. Go to AWS S3 and verify it's upload or not.

       Here you can see all the files are uploaded in Jenkins Build number's folder.