diff --git a/Jenkinsfile b/Jenkinsfile index 6addbe0..0767031 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,21 +11,23 @@ pipeline { stages { stage('Download source code from Git') { steps { - switch(GIT_BRANCH) { - case "vapor/production": - git( - url: 'https://gitlab.com/CIEFWorldwideSdnBhd/vapor-laravel-explore.git', - credentialsId: 'gitlab-jenkins-localhost', - branch: 'vapor/production' - ) - break - case "vapor/staging": - git( - url: 'https://gitlab.com/CIEFWorldwideSdnBhd/vapor-laravel-explore.git', - credentialsId: 'gitlab-jenkins-localhost', - branch: 'vapor/staging' - ) - break + script{ + switch(GIT_BRANCH) { + case "vapor/production": + git( + url: 'https://gitlab.com/CIEFWorldwideSdnBhd/vapor-laravel-explore.git', + credentialsId: 'gitlab-jenkins-localhost', + branch: 'vapor/production' + ) + break + case "vapor/staging": + git( + url: 'https://gitlab.com/CIEFWorldwideSdnBhd/vapor-laravel-explore.git', + credentialsId: 'gitlab-jenkins-localhost', + branch: 'vapor/staging' + ) + break + } } } }