pipeline { agent any stages { stage('common') { //每个stage为一流程,与脚本式基本一致,每个stage可以定义名称 steps { //步骤块,内部包含具体操作 sh 'rm -fr /tmp/jenkins-test;mkdir -p /tmp/jenkins-test' dir('/tmp/jenkins-test'){ sh 'echo 小伟哥的分支:${Branch}' sh 'git clone -b ${Branch} https://lixiaoweihan:LIXIAOWEI@git.pispower.com.cn/do1/syeb/yweb/summit/summit-cloud-common.git' sh 'cd summit-cloud-common; mvn install' } } } stage('live'){ steps { //步骤块,内部包含具体操作 dir('/tmp/jenkins-test'){ sh 'echo 小伟哥的live分支:${Branch}' sh 'git clone -b ${Branch} https://lixiaoweihanLIXIAOWEI@git.pispower1.com.cn/do1/syeb/yweb/summit/summit-cloud-live.git' sh 'cd summit-cloud-live; mvn clean install -pl model,client -am -DskipTests=true' } } } } }