Git

Functions related to Git

setGitEnvironmentVariables

Set GIT_COMMIT and GIT_COMMIT_SHORT environment variables.

Example

setGitEnvironmentVariables()

getGitBranch

Get name of the current Git Branch.

Returns a Groovy String.

Usage

def name = getGitBranch()

getGitTags

Get Git Tags for the current commit.

Returns a Groovy Array.

Usage

def tags = getGitTags()

skipTheBuild

Returns True if the build should be skipped because the string "[ci skip]" appears in the HEAD git commit message.

Usage

if ( skipTheBuild() ) {
    println "Skipping this build"
    return
}