Jenkins 从远程主机下载文件插件-SSH Pipeline Steps
插件官网:SSH Pipeline Steps此插件可通过SSH在远程服务器执行命令和传输文件。pipeline代码,本例是取一个zip文件。为了提高安全性用Credentials Plugin屏蔽用户名密码。Credentials Plugin配置withCredentials([usernamePassword(credentialsId: 'JMeter_Master', pas...
·
插件官网:SSH Pipeline Steps
此插件可通过SSH在远程服务器执行命令和传输文件。
pipeline代码,本例是取一个zip文件。为了提高安全性用Credentials Plugin屏蔽用户名密码。Credentials Plugin配置
withCredentials([usernamePassword(credentialsId: 'JMeter_Master', passwordVariable: 'password', usernameVariable: 'username')]) {
script {
def remote = [:]
remote.name = 'jmeter'
remote.host = '192.168.1.11'
remote.user = "$username"
remote.password = "$password"
remote.allowAnyHosts = true
sshGet remote: remote, from: "/opt/jmeter-JTLReport/${JOB_BASE_NAME}/$REPORT_JTL_FILE", into: "${env.WORKSPACE}", override: true
sshGet remote: remote, from: "/opt/jmeter-ZIPReport/${JOB_BASE_NAME}/$REPORT_ZIP_FILE", into: "${env.WORKSPACE}", override: true
}
}
}
更多推荐
已为社区贡献27条内容
所有评论(0)