参考:https://blog.csdn.net/wx17343624830/article/details/136906665
参考:https://blog.csdn.net/Step_By_XXX/article/details/131470414
pipeline { agent any tools{ maven 'Maven-3.9.6' } parameters { gitParameter branchFilter: 'origin/(.*)', name: 'branch', type: 'Branch', defaultValue: 'prod', description: 'Select the Git branch to build' } environment { //全局变量,会在所有stage中生效 ip = '192.168.0.157' } stages { stage('拉取git代码') { steps { echo "$branch" git branch: "$branch", credentialsId: 'my_id_rsa', url: 'ssh://[email protected]:1130/som/data-api-java/ms-provider/som-commerce.git' } } stage('构建代码') { steps { sh " mvn clean package -P prod " } } stage('部署') { steps { sh ''' ''' } } } }
标签:git,som,csdn,steps,branch,流水线,jenkinsfile,stage From: https://www.cnblogs.com/lfxx/p/18198301