mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-21 13:33:57 +00:00
Test deployment to vapor with dynamic commit message from git
This commit is contained in:
Vendored
+11
-2
@@ -29,9 +29,18 @@ pipeline {
|
||||
|
||||
stage('get_commit_msg') {
|
||||
steps {
|
||||
// script {
|
||||
// commit = sh(returnStdout: true, script: 'git log -1 --oneline').trim()
|
||||
// env.GIT_COMMIT_MSG = commit
|
||||
// }
|
||||
script {
|
||||
commit = sh(returnStdout: true, script: 'git log -1 --oneline').trim()
|
||||
env.GIT_COMMIT_MSG = commit
|
||||
def gitExecutable = sh(returnStdout: true, script: 'which git').trim()
|
||||
if (gitExecutable) {
|
||||
commit = sh(returnStdout: true, script: "${gitExecutable} log -1 --oneline").trim()
|
||||
env.GIT_COMMIT_MSG = commit
|
||||
} else {
|
||||
echo "Git not found in PATH. Please make sure Git is installed and in the system PATH."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user