From 7d4bb73640c4d902e9d4d7bd9cf2090f9388aa32 Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Tue, 4 Oct 2016 00:51:14 +0200 Subject: [PATCH] SO and UI start_build changed to support checking out a commit-id, branch or tag Change-Id: Id28634bc44898cbfe4e548c3767ce74aff6bba5c Signed-off-by: garciadeblas --- jenkins/SO/start_build | 11 ++++++++--- jenkins/UI/start_build | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) 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 -- 2.25.1