I have a Maven 3 job configured in my Hudson server.
When the Hudson server successfully builds the Maven jar, I have the jar being deployed to an SCP repository on another server.
I want to execute a relink.sh script on the remote host where one of the parameters is the name of the newly delivered jar file (e.g. /usr/bin/relink.sh myproject-0.0.2-SNAPSHOT.jar).
How do I get that Maven-based file / version name into a variable that I can then use in my Hudson call to execute the remote script?
Best Answer
I'm not sure if you can or can't pass the variable, but a work-around would be to first copy the file to a staging directory, instead of directly to where you want it to go. Then have your script look in the staging directory for a file and move it:
You might want to do some error checking and exit with non-0 if there is, e.g., more than one file that matches, no files, etc. Have you solved the issue?