Jenkins git插件未设置环境变量

我正在使用jenkins git插件,如下面的管道代码(groovy)所示。检出有效,但未设置环境变量。

node(){
   dir("${WORKAREA}") {
               //checkout uses mirror repo to make creation of new repo faster and smaller
               //clean is done after checkout (rsync was doing this part)
               performCheckout(REPO,BRANCH,BITBUCKET_PROJECT_URL,UNIVERSAL_REFERENCE_REPO_PATH)
               sh("env")

   }
}

private void performCheckout(REPOSITORY,String BITBUCKET_PROJECT_URL,String UNIVERSAL_REFERENCE_REPO_PATH) {
   //standard plugin for checkout
   checkout changelog: true,poll: false,scm: [$class                           : 'GitSCM',branches                         : [[name: "refs/remotes/${REPOSITORY}/${BRANCH}"]],doGenerateSubmoduleConfigurations: false,extensions                       : [[$class   : 'CloneOption',depth    : 1,noTags   : true,reference: "${UNIVERSAL_REFERENCE_REPO_PATH}",shallow  : false,[$class             : 'SparseCheckoutPaths',sparseCheckoutPaths: [
                                                              [path: '!/tests/*'],[path: '/*']]],[$class: 'CleanCheckout',timeout: 40],[$class: 'CheckoutOption',timeout: 75]],gitTool                          : 'Default',submoduleCfg: [],userRemoteConfigs                : [
                         [credentialsId: 'privatekey',name         : "${REPOSITORY}",url          : "${BITBUCKET_PROJECT_URL}/${REPOSITORY}.git"]
                 ]]
}

当我在管道中打印env( sh(“ env”))时,它不会打印GIT_ *环境变量。知道怎么了吗?

djr15 回答:Jenkins git插件未设置环境变量

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3105725.html

大家都在问