I have never seen such a plugin, but Jenkins already has similar functionality.
You can use /*zip*/filename.zip in your path to the artifact, where filename is all you choose. It will take all the artifacts found and upload them to the zipfile (you can get the zip inside the zip if your artifact is already a zip file)
In your case, it will be:
http://myjenkins.local/job/MyJob/lastSuccessfulBuild/artifact/build/*zip*/MyJob-latest.zip
This will give you the contents of /artifact/build/ returned in the zipped archive named MyJob-latest.zip . Please note: if not only this zip file is in this directory, other files will also be returned.
You can use wildcards in the path. One * for a regular wildcard - double ** to skip any number of previous directories.
For example, to get any file starting with MyJob ends in .zip , and to search for it in any artifact directory, you can use:
/lastSuccessfulBuild/artifact/**/MyJob*.zip/*zip*/MyJob-latest.zip
Edit:
You cannot do something like this without any form of container (in this case, zip). With the container, you tell the system:
- Get any possible (indefinite amount) wildcard match and put it in this container, and then give me the container. This is logical and possible, since there is only one container, empty or not.
But you cannot tell the system:
- Give a link to a specific separate file, but I do not know which one or how many there are. The system cannot guarantee that your wildcards will match one, more than one, or no one. This is simply not possible from a logical point of view.
If you need this for some automation script, you can unzip the first level zip code and stay with your desired zip artifact.
If you need to provide this link to someone else, you need an alternative solution.
Alternative 1:
After the assembly is completed, follow the assembly step that takes your artifact and rename it to MyJob-latest.zip , but you will lose version control in the file name. You can also copy instead of renaming, but in the end you double the space used to store these artifacts.
Alternative 2 (recommended): As an action after assembly, upload the artifact to the central repository. It could be Artifactory or even a simple SVN. When you download it, it will be renamed MyJob-latest.zip , and the previous one will be overwritten. So you have a static link that will always have the last artifact from lastSuccessfulBuild