Add function getGitDescribe
Function getGitCommitDescribe describes commit based on
recent git tag
Change-Id: I2e83923fcfb0800a4a1b5d7b5fc67942d02ed051
diff --git a/src/ci/mcp/Tools.groovy b/src/ci/mcp/Tools.groovy
index 6f4d788..fb552ea 100644
--- a/src/ci/mcp/Tools.groovy
+++ b/src/ci/mcp/Tools.groovy
@@ -100,6 +100,17 @@
}
/**
+ * Describe a commit using the most recent tag reachable from it
+ */
+def getGitDescribe() {
+ git_commit = sh (
+ script: 'git describe --tags',
+ returnStdout: true
+ ).trim()
+ return git_commit
+}
+
+/**
* Generate current timestamp
*
* @param format Defaults to yyyyMMddHHmmss