Can we run Jenkins build for a different machine like my script is on another remote machine and my Jenkins setup is on a different remote machine? I have multiple JMX scripts created on different machines but I want to run them from Jenkins on a single machine
CodePudding user response:
Yes, there are multiple ways to do this. One way is you can use the Jenkins SSH Steps plugin for this. Following is an example for a remote execution of a command.
node {
def remote = [:]
remote.name = 'test'
remote.host = 'test.domain.com'
remote.user = 'root'
remote.password = 'password'
remote.allowAnyHosts = true
stage('Remote SSH') {
sshCommand remote: remote, command: "ls -lrt"
sshCommand remote: remote, command: "for i in {1..5}; do echo -n \"Loop \$i \"; date ; sleep 1; done"
}
}
CodePudding user response:
Either connect these machines to Jenkins as Build Agents and set your project or pipeline to execute on the remote machine(s) or install JMeter Slaves on those machines and run your test on Jenkins having JMeter Master there.
More information: