完整pipeline
pipeline { agent any options{ timestamps () } stages { stage('get code ') { steps { deleteDir() checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'git@123.com:newback/123.git']]]) } } stage('Checkout') { steps { echo '开始拉develop分支.....' git branch: "develop",credentialsId: 'GitHubAccess', url: 'git@123.com:newback/123.git' } } stage ('get develop') { steps { sh ''' go build -o cost-srv . ''' } } } }