pipeline{
environment{
localPath = '/Users/jasqia/Desktop'
}
agent:any
stages{
stage("Stage 1"){
steps {
script{
buildDescription 'PYTHON_ENV: ${PYTHON_ENV} USERNAME: ${AUTO_USERNAME} BUCKET:${CLIENT_BUCKET}'
}
}
}
stage("Stage 2"){
steps {
echo 'It is pulling code for remote qe github...'
script{
checkout([$class: 'GitSCM', branches: [[name: 'jasQian']],userRemoteConfigs: [[credentialsId: '03ed9bf8-701d-4270-a1e8-a6aa1e74c9f6', url: 'git@github.com:xxx.git']]])
}
}
}
stage("Stage 3"){
steps {
echo 'copy application.properties....'
script{
def workspace = pwd()
sh """cp -f ${localPath}/application.properties ${workspace}/src/main/resources/"""
}
}
}
stage("Stage 4"){
steps {
echo 'mvn package....'
script{
sh ' /usr/local/Cellar/maven/3.8.1/libexec/bin/mvn package'
}
}
}
}
post {
always {
cleanWs()
}
}
}
Original: https://www.cnblogs.com/qianjinyan/p/15021409.html
Author: 巴黎爱工作
Title: Jenkins Pipeline ample 样板
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/553058/
转载文章受原作者版权保护。转载请注明原作者出处!