How do I use Jenkins s3 publish plugin to the same location for every build?

Viewed 1469

I am using Jenkins to build my application, which I then need to publish to s3. One of the outputs is an installation exe file that I then provide as a link to users of the application. Because of this I need this installer file to always be in the same place, for every build. However, no matter how I set up my S3 Publishing post-build step the the artifacts are uploaded to a separate folder for every build, like so s3 structure

Is there a way for me to set up the publish to the root of the directory/bucket every time, overwriting the old file if neccesary? This would eliminate the jobs/TestTrayApp/{buildnumber} directories. This is my s3 publish post-build step setup:

enter image description here

3 Answers

Unselect both Manage artifacts and Flatten directories checkboxes. And as per the Source give the directory name followed by a / which contains your executable. For example:

enter image description here

This way your latest executable will always be placed in bucket/blahblahblah/executable/executable.exe location no matter how many times your job runs.

Related