| 1234567891011121314151617181920212223242526272829 |
- def clone2(String projAddr, String projCredentialId, String base_branch) {
- echo "-----> Check out project source from branch($base_branch)..."
- dir("projdir"){
- // git branch: "$base_branch",
- // credentialsId: "${projCredentialId}",
- // url: "${projAddr}"
- checkout([$class: 'GitSCM',
- branches: [[name: "$base_branch"]],
- doGenerateSubmoduleConfigurations: false,
- extensions: [[$class: 'CleanBeforeCheckout'], [$class: 'CloneOption', depth: 1, noTags: false, reference: '', shallow: true, timeout: 240]],
- submoduleCfg: [],
- userRemoteConfigs: [[credentialsId: "${projCredentialId}", url: "${projAddr}"]]
- ])
- COMMIT_SHA = sh(returnStdout: true, script: 'git rev-parse --short HEAD').trim()
- }
- }
- def clone(Object gitConf, String base_branch) {
-
- echo "-----> Check out project source from branch($base_branch)..."
- dir("projdir"){
- git branch: "$base_branch",
- credentialsId: "${gitConf.credentialId}",
- url: "${gitConf.address}"
- COMMIT_SHA = sh(returnStdout: true, script: 'git rev-parse --short HEAD').trim()
- }
- }
- return this
|