From a6879e6bc90cd8936fd06d5d959e9631d8b3653a Mon Sep 17 00:00:00 2001 From: Dillon Ngo Date: Thu, 23 Nov 2023 13:09:41 +0800 Subject: [PATCH] Test deployment to vapor with dynamic commit message from git --- Jenkinsfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index db05973d..8aa70d4a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -24,6 +24,7 @@ pipeline { credentialsId: 'gitlab-jenkins-localhost', branch: 'dillon/34-jenkins-vapor' ) + env.GIT_COMMIT_MSG = sh (script: 'git log -1 --pretty=%B ${GIT_COMMIT}', returnStdout: true).trim() } } @@ -41,10 +42,7 @@ pipeline { stage('Deploy') { steps { - checkout scm - commitMessage = sh(script: 'git log -1 --pretty=%B', returnStdout: true).trim() - sh "vendor/bin/vapor deploy staging --message='${commitMessage}'" - //sh 'vendor/bin/vapor deploy staging --message="Test Jenkins"' + sh 'vendor/bin/vapor deploy staging --message=${GIT_COMMIT_MSG}' } }