X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=jenkins%2Ftemplate%2Fstart_build;h=2bd9074b40b934444c5860794329cfb57a3685eb;hb=63dd284a321fbf65d563f5e65a419146ec7c50e5;hp=2b006771cb4b3b5cbe8ea73182181c1da7a6711b;hpb=f13ff902d8cd2046fcb19c0c6a99768055fc6105;p=osm%2Fdevops.git diff --git a/jenkins/template/start_build b/jenkins/template/start_build index 2b006771..2bd9074b 100755 --- a/jenkins/template/start_build +++ b/jenkins/template/start_build @@ -37,13 +37,29 @@ else git clone $OSM_GIT_URL/$OSM_MDG cd $OSM_MDG fi -INFO "starting build" +# Gerrit arranges to call this script with two parameters -- the refspec and commit ID that needs to be built +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" +else + INFO "Code to compile: master" + git checkout master +fi + +INFO "starting build" ### for start_build ### put your commands here to ### build, test and produce coverage reports +# E.G. +#make clean || FATAL "make clean failed" +#make || FATAL "make failed" +#sudo make install || FATAL "make install failed" -INFO "done" +RC=0 +INFO "done, RC=$RC" +exit $RC