1、 使用SSHpipeline Steps訪問遠程機器:
?1.1、在jenkins上安裝SSHpipeline Step Plugins

1.2、創(chuàng)建pipelinejob

1.3、編寫pipeline腳本:
???? pipeline{
???agent any
???stages {
???????stage ('Pipeline configuration') {
??????????????? agent none
??????????????? steps {
????????????????????? script {
??????????????????????? stage ('Pull & PushImage') {
????????????????????????? def remote = [:]
????????????????????????? remote.name = 'test'
????????????????????????? remote.host ='192.168.248.190'
?????????????????????? ???remote.user = 'root'
????????????????????????? remote.password ='password'
????????????????????????? remote.allowAnyHosts= true
????????????????????????? writeFile file:'jemeter.sh', text: 'cd /ibm \n ls'
????????????????????????? sshScript remote: remote,script: "jemeter.sh"
??????????????????????????? }
?????????????????????? }
????????????????? }???
???????????}
??????}
}