Jenkins pipeline pipeline log in SSH remote machine

1. Installation SSHpipeline Step Plugins on jenkins

2.scripts

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"

                            }

                       }

                  }   

           }

      }

}



Author: sckehan
link: https: //www.jianshu.com/p/e8a4fdef1805
Source: Jane book
Jane book copyright reserved by the authors, are reproduced in any form, please contact the author to obtain authorization and indicate the source.

Guess you like

Origin blog.csdn.net/tojava/article/details/93843768