From de38f2829c5b1c272080feaeba4d7c8b76f4b177 Mon Sep 17 00:00:00 2001 From: William Date: Wed, 5 Dec 2018 08:37:46 +1100 Subject: [PATCH] Added Jenkinsfile --- Jenkinsfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8da91969..334ea45d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,8 +3,13 @@ pipeline { stages { stage('Get coriolis-data') { steps { - sh '''cd .. -git clone https://github.com/edcd/coriolis-data.git''' + sh '''YES=`echo $GIT_BRANCH | awk -F / \'{print $2}\'` +export BRANCH=`git rev-parse --abbrev-ref $YES` +rm -rf $WORKSPACE/../coriolis-data +git clone https://github.com/edcd/coriolis-data.git $WORKSPACE/../coriolis-data +cd ../coriolis-data +git fetch --all +git checkout $BRANCH''' } } }