Update 'Jenkinsfile'

add split to env var GIT_BRANCH
This commit is contained in:
Roberto Cirillo 2022-09-21 10:32:35 +02:00
parent 23903a87af
commit 23fccd6314
1 changed files with 3 additions and 2 deletions

5
Jenkinsfile vendored
View File

@ -13,6 +13,7 @@ pipeline {
environment {
JAVA_HOME='/usr/lib/jvm/java-8-openjdk-amd64'
// GIT_URL= "${params.GIT_URL}"
GIT_BRANCH= "${params.GIT_BRANCH.split("/")[1]}"
// GIT_BRANCH= "${params.GIT_BRANCH}"
}
parameters {
@ -27,10 +28,10 @@ pipeline {
echo " env GIT_URL: ${env.GIT_URL}"
echo " env GIT_BRANCH: ${env.GIT_BRANCH}"
echo " param GIT_URL: ${params.GIT_URL}"
echo " env GIT_BRANCH: ${params.GIT_BRANCH}"
echo " param GIT_BRANCH: ${params.GIT_BRANCH}"
echo " GIT_URL: ${GIT_URL}"
echo " GIT_BRANCH: ${GIT_BRANCH}"
git branch: '${params.GIT_BRANCH}', credentialsId: '88b54962-1c0e-49cb-8155-22276860f346', url: "${GIT_URL}"
git branch: '${GIT_BRANCH}', credentialsId: '88b54962-1c0e-49cb-8155-22276860f346', url: "${GIT_URL}"
}
}
stage('Build the job') {