jenkins【ssh】【远程执行】

  1. https://www.jenkins.io/doc/pipeline/steps/ssh-steps/
node {
  def remote = [:]
  remote.name = 'test'
  remote.host = 'test.domain.com'
  remote.user = 'root'
  remote.password = 'password'
  remote.allowAnyHosts = true
  stage('Remote SSH') {
    writeFile file: 'abc.sh', text: 'ls -lrt'
    sshScript remote: remote, script: "abc.sh"
  }
}

posted @ 2021-12-21 20:45  该显示昵称已被使用了  阅读(50)  评论(0编辑  收藏  举报