From 258c53dbdb4d2faf3c1c6c84bb00272dab9dc3ac Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Thu, 23 Nov 2023 14:39:46 +0800 Subject: [PATCH] Test deployment to vapor with dynamic commit message from git --- Jenkinsfile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e05862b0..87720f26 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,13 +19,19 @@ pipeline { stages { stage('Download source code from Git') { steps { - scmVars = git( + git( url: httpUrl, credentialsId: 'gitlab-jenkins-localhost', branch: 'dillon/34-jenkins-vapor' ) - commitHash = scmVars.GIT_COMMIT - echo commitHash + } + } + + stage('Get Commit Message for Deployment') { + steps { + script { + env.GIT_COMMIT_MSG = sh (script: 'git log -1 --pretty=%B ${GIT_COMMIT}', returnStdout: true).trim() + } } }