Ruslan Kamaldinov | 90d4e67 | 2016-11-11 18:31:00 +0300 | [diff] [blame] | 1 | package com.mirantis.mcp |
2 | |||||
3 | /** | ||||
4 | * Parse HEAD of current directory and return commit hash | ||||
5 | */ | ||||
6 | def 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 | */ | ||||
17 | def getGitDescribe() { | ||||
18 | git_commit = sh ( | ||||
19 | script: 'git describe --tags', | ||||
20 | returnStdout: true | ||||
21 | ).trim() | ||||
22 | return git_commit | ||||
23 | } |