From 04690ab79a3ad1240ab5855979860aab01ba97b0 Mon Sep 17 00:00:00 2001 From: rawlingsj Date: Thu, 5 Oct 2017 14:11:13 +0100 Subject: [PATCH] fix(release): checkout branch and avoid being in a detached HEAD --- Jenkinsfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 029f37e..39bfe20 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -5,9 +5,10 @@ def org = 'fabric8-ui' def repo = 'ngx-base' fabric8UINode{ ws { - git "https://github.com/${org}/${repo}.git" + checkout scm + readTrusted 'release.groovy' - sh "git remote set-url origin git@github.com:${org}/${repo}.git" + def pipeline = load 'release.groovy' if (utils.isCI()){ @@ -15,6 +16,9 @@ fabric8UINode{ pipeline.ci() } } else if (utils.isCD()){ + sh "git checkout master" + sh "git remote set-url origin git@github.com:${org}/${repo}.git" + def branch container('ui'){ branch = utils.getBranch()