blob: 487408467b6764bac3ed2d4f2e93d67172361a42 [file] [log] [blame]
Ruslan Kamaldinov90d4e672016-11-11 18:31:00 +03001package com.mirantis.mcp
2
3/**
4 * Parse HEAD of current directory and return commit hash
5 */
6def getGitCommit() {
7 git_commit = sh(
8 script: 'git rev-parse HEAD',
9 returnStdout: true
10 ).trim()
11 return git_commit
12}
13
14/**
15 * Describe a commit using the most recent tag reachable from it
16 */
17def getGitDescribe() {
18 git_commit = sh (
19 script: 'git describe --tags',
20 returnStdout: true
21 ).trim()
22 return git_commit
23}