From 9997237049bc2403dcdae9fd8a4ab96c8ad973b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Mass=C3=A9?= Date: Wed, 2 May 2018 07:41:27 +0200 Subject: [PATCH] jenkins --- Jenkinsfile | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e1bb114..2f988f4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,33 +2,33 @@ import groovy.json.JsonOutput // for inline scripts -//def gitRepo = "https://github.com/nmasse-itix/summit-api.git" -//def gitBranch = "master" - -// For Jenkinsfile from GIT -def gitRepo = scm.getUserRemoteConfigs()[0].getUrl() -def gitBranch = scm.getUserRemoteConfigs()[0].getRefspec() +def gitRepo +def gitBranch node('nodejs') { - def towerExtraVars = [ - git_repo: gitRepo, - git_branch: gitBranch, - threescale_cicd_api_backend_hostname: params.OPENSHIFT_SERVICE_NAME, - threescale_cicd_api_backend_scheme: "http" - ] - // Get Source Code from SCM (Git) as configured in the Jenkins Project stage('Checkout Source') { // For Jenkinsfile from GIT checkout scm + gitRepo = scm.getUserRemoteConfigs()[0].getUrl() + gitBranch = scm.getUserRemoteConfigs()[0].getRefspec() - echo "${gitBranch}" + echo "${gitRepo} ${gitBranch}" sh 'false' // for inline scripts //git url: gitRepo + //gitRepo = "https://github.com/nmasse-itix/summit-api.git" + //gitBranch = "master" } + def towerExtraVars = [ + git_repo: gitRepo, + git_branch: gitBranch, + threescale_cicd_api_backend_hostname: params.OPENSHIFT_SERVICE_NAME, + threescale_cicd_api_backend_scheme: "http" + ] + def thisPackage = readJSON file: 'package.json' def currentVersion = thisPackage.version def newVersion = "$currentVersion-$BUILD_NUMBER"