node{
stage('clean file'){
sh 'rm -rf openapi'
sh 'ls -l'
}
stage('Clone Code') {
// for display purposes
// Get some code from a GitHub repository
git url: '[email protected]/xxxxx.git', branch: 'master'
sh 'git branch -a'
sh 'git rev-parse --short HEAD'
}
stage('Code Analysis') {
def mvnHome = tool 'M3'
env.PATH = "${mvnHome}/bin:${env.PATH}"
sh "mvn -version"
sh "mvn clean"
}
stage('Package') {
sh "mvn install -Dmaven.test.skip -U"
archive '**/web/target/*.war'
}
stage('Deploy') {
//build 'deploy'
echo 'pipeline success'
}
stage('scp'){
sh 'ls -l'
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'dev',
usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) {
sh "echo '${PASSWORD}'|scp -o StrictHostKeyChecking=no web/target/xxxxx.war ${USERNAME}@192.168.0.18:~/application/"
}
}
}
jenkins-pipelines
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.