Skip to content

Commit

Permalink
learning about jenkins current git commit
Browse files Browse the repository at this point in the history
  • Loading branch information
rwilcox committed May 14, 2020
1 parent ffb4e94 commit 6fb9863
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions learning_jenkins.md
Expand Up @@ -778,6 +778,19 @@ This will install a custom tool configured as such:

Checking to see if a custom tool is installed follows the same pattern as any other plugin instance. (see Learning_Jenkins_Provisioning_Init_Script_Installing_Tools_Example).

# Source code systems and common questions

## How do I get the current git commit?

there used to be `env.GIT_COMMIT` but I found it missing the other day

do something like this instead

def res = checkout scm
env.GIT_COMMIT = res.GIT_COMMIT

[Source](https://serverfault.com/a/950721)

# Book Recommendations

* [Jenkins 2 Up and Running](https://www.amazon.com/Jenkins-Deployment-Pipeline-Generation-Automation-dp-1491979593/dp/1491979593/ref=as_li_ss_tl?_encoding=UTF8&me=&qid=1555872327&linkCode=ll1&tag=wilcodevelsol-20&linkId=b957401def3d0944e387cddbf5d4c5d6&language=en_US)
Expand Down

0 comments on commit 6fb9863

Please sign in to comment.