I want to SSH to a different machine that is not a build machine (not in Jenkins nodes) and then clone my repo there and then perform all the build steps there.
How do I achieve this?
I want to SSH to a different machine that is not a build machine (not in Jenkins nodes) and then clone my repo there and then perform all the build steps there.
How do I achieve this?
In Pipeline use the ssh pipeline steps plugin
my project is a freestyle job.
really recommend moving from freestyle to pipeline, it’ll make things more managable and let you manage configuration by code instead of random UI stuff.
SSH Agent works fine with freestyle
then add a shell step of ssh $server "cd /path/to/place; git clone url; make build"
If you want a little more of the Jenkins capabilities in your job and if the target machine has rsync, then you might consider some additional steps:
rsync -a --delete . target-machine:/home/target-user/.
)ssh target-machine make all
)rsync -a --delete target-machine:/home/target-user/..
)That provides a few more of the benefits of Jenkins jobs without requiring that the target is able to run a Jenkins agent.