Jenkins:“ $ {env.SVN_REVISION}”变量返回null

问题描述 投票:0回答:1

当工作失败时,我想从詹金斯工作中读取修订号

修订号:

enter image description here

作业脚本:

failure {
        echo 'JENKINS PIPELINE FAILED'

         notifyBitbucket 
            commitSha1: "${env.SVN_REVISION}", 
            considerUnstableAsSuccess: false, 
            credentialsId: 'UFCBitbucket', 
            disableInprogressNotification: true, 
            ignoreUnverifiedSSLPeer: true, 
            includeBuildNumberInKey: false, 
            prependParentProjectKey: false, 
            projectKey: '', 
            stashServerBaseUrl: 'https://bitbucket.url.local:8080'
    }

我在Jenkins环境变量中遇到麻烦-“ $ {env.SVN_REVISION}”。此变量返回空值。

我无法解决此问题。请帮忙解决这个问题在此先感谢

jenkins jenkins-plugins jenkins-cli
1个回答
0
投票

我不认为env变量SVN_REVISION甚至不存在。

可以看到所有可用的Git插件env变量here(和非官方来源here

我建议您使用以下内容进行修订:

GIT_COMMIT-此构建中使用的提交的SHA1

© www.soinside.com 2019 - 2024. All rights reserved.