dongwei7913
dongwei7913
2017-06-27 07:35

使用gradle将php文件写入服务器

  • gradle
  • ant
  • devops
  • jenkins
  • php

I want to transfer PHP Files into sever Using gradle .I tried with below script but i dont how to pass username and password.

plugins {
  id 'org.hidetake.ssh' version 'x.y.z'
}

remotes {
  webServer {
    host = '192.168.1.101'
    user = 'jenkins'
    identity = file('id_rsa')
  }
}

task deploy {
  doLast {
    ssh.run {
      session(remotes.webServer) {
        put from: 'example.war', into: '/webapps'
      }
    }
  }
}
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答

为你推荐