How to add button on post build page to copy artifacts on shared drive?

41 views
Skip to first unread message

Mathias Awox

unread,
Dec 7, 2017, 11:42:51 AM12/7/17
to Jenkins Users

I'd like to add a button on build pages that will extract and copy the build's artifacts on a shared drive.


We want to control when the artifacts are exported, so we don't want to add this export as a new build step, but rather trigger the export using a new button on the post build page.


What is the best way for doing that please ?


Is there a existing plugin for that ?

Victor Martinez

unread,
Dec 7, 2017, 12:07:43 PM12/7/17
to Jenkins Users
What about using the promote builds plugin


Mathias Awox

unread,
Dec 13, 2017, 9:12:34 AM12/13/17
to Jenkins Users
Thanks for the link

How would I specify  the destination directory in which the artifacts should be copied please ?

Victor Martinez

unread,
Dec 13, 2017, 9:55:09 AM12/13/17
to Jenkins Users
If you meant about using the promote build plugin, you can add some input parameters in the job and then use those parameters within the promotion stage, since they are populated. For instance:




Then when you promote it  yo uwill see something like 


Started by user anonymous
Building in workspace /var/jenkins_home/workspace/promote
Promoting promote #3
[promote] $ /bin/sh -xe /tmp/jenkins389158040050727821.sh
+ echo bar
bar
build hudson.tasks.Shell@23588bc7 SUCCESS
Finished: SUCCESS



Cheers


Mathias Awox

unread,
Dec 14, 2017, 8:33:17 AM12/14/17
to Jenkins Users

Thanks Victor

May I ask you for further help regarding the script needed to copy artifact files into the desired location ?

Victor Martinez

unread,
Dec 14, 2017, 11:34:08 AM12/14/17
to Jenkins Users
I guess, that's more specific about your use case, but if that's something about how to do it within Jenkins, please go ahead, likely others can provide you some feedback too :)
Reply all
Reply to author
Forward
0 new messages