Accessing SCM (Git) variables on a Jenkins Pipeline job [duplicate]

不问归期 提交于 2019-11-30 08:03:36
Chida

Here is an example of how you can get GIT_COMMIT - https://github.com/jenkinsci/pipeline-examples/blob/master/pipeline-examples/gitcommit/gitcommit.groovy

You can extend it to expose GIT_BRANCH as well. This script is from the workflow examples git repo managed by cloudbees. Maybe you can send a pull request if you add capability to retrieve GIT_BRANCH variable.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!