From: garciadeblas Date: Mon, 3 Oct 2016 22:51:14 +0000 (+0200) Subject: SO and UI start_build changed to support checking out a commit-id, branch or tag X-Git-Tag: v1.0.0~8 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=7d4bb73640c4d902e9d4d7bd9cf2090f9388aa32;p=osm%2Fdevops.git SO and UI start_build changed to support checking out a commit-id, branch or tag Change-Id: Id28634bc44898cbfe4e548c3767ce74aff6bba5c Signed-off-by: garciadeblas --- diff --git a/jenkins/SO/start_build b/jenkins/SO/start_build index ac07fc7f..8094a39d 100755 --- a/jenkins/SO/start_build +++ b/jenkins/SO/start_build @@ -39,9 +39,14 @@ else fi if [ $# -gt 0 ]; then - INFO "Code to compile: gerrit refspec '$1', commit-id: '$2'" - git fetch origin $1 || FATAL "git fetch origin '$1' didn't work" - git checkout -f $2 || FATAL "git checkout -f '$2' didn't work" + if [ "$1" = "checkout" ]; then + INFO "Code to compile: '$2'" + git checkout $2 + else + INFO "Code to compile: gerrit refspec '$1', commit-id: '$2'" + git fetch origin $1 || FATAL "git fetch origin '$1' didn't work" + git checkout -f $2 || FATAL "git checkout -f '$2' didn't work" + fi else INFO "Code to compile: master" git checkout master diff --git a/jenkins/UI/start_build b/jenkins/UI/start_build index b05a7e26..af495e96 100755 --- a/jenkins/UI/start_build +++ b/jenkins/UI/start_build @@ -39,9 +39,14 @@ else fi if [ $# -gt 0 ]; then - INFO "Code to compile: gerrit refspec '$1', commit-id: '$2'" - git fetch origin $1 || FATAL "git fetch origin '$1' didn't work" - git checkout -f $2 || FATAL "git checkout -f '$2' didn't work" + if [ "$1" = "checkout" ]; then + INFO "Code to compile: '$2'" + git checkout $2 + else + INFO "Code to compile: gerrit refspec '$1', commit-id: '$2'" + git fetch origin $1 || FATAL "git fetch origin '$1' didn't work" + git checkout -f $2 || FATAL "git checkout -f '$2' didn't work" + fi else INFO "Code to compile: master" git checkout master