Jenkins publishes over SSH - same commands for all servers

I want to use the SSH Jenkins publishing plugin to transfer some files and then run some commands on the target Linux machine. This target machine should be listed as a build parameter though, since we have about 10 potential target machines.

I know I can use parameterized publishing to choose which host to use for publishing during the SSH build step, but I feel like I have to define every possible server here and duplicate a set of files and commands for each one. Is there a way to provide a set of files and commands only once and apply them to all potential target machines?

those. Is it possible to specify the bit in the red circle in this screenshot once for both servers? And I don't mean to just put those commands in a script and pass that to all servers - I would still need to put a pass command in every server config block.

Thanks Sara

enter image description here

+3


source to share





All Articles