【发布时间】:2018-11-09 15:29:16
【问题描述】:
我在 Jenkins 配置文件中有一些 files.properties,我需要在 jenkins 管道期间将其复制到服务器。
管道代码更像是一个更少的显示,只是为了得到一个想法。 如何添加一个步骤,在 las 步骤之后在目标服务器上复制此配置文件的步骤 DEPLOY WAR TO SERVER 在管道中,例如:“sh Scp file.properties jenkins@destinationserver:/destination/path/file.properties "
code {
stage ('Code Checkout') {
git branch: 'master',
credentialsId: 'b346fbxxxxxxxxxxxxxxxxxxx',
url: 'https://xxxxxxx@bitbucket.org/gr/code.git'
}
stage ('Check Branch') {
sh 'git branch'
}
stage('Compile and Build WAR') {
sh 'mvn clean compile war:war'
stage ('Deploy WAR to server') {
sh "scp .war jenkins@serverIp:/var/lib/tomcat/.war"
}
【问题讨论】:
标签: jenkins jenkins-pipeline configuration-files