X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=jenkins%2Ftemplate%2Fstart_build;fp=jenkins%2Ftemplate%2Fstart_build;h=2bd9074b40b934444c5860794329cfb57a3685eb;hb=9713ede3423f7f53bc52cc8b8c7f6eb601b6d30b;hp=38f35b5bd3d64c5a0027b216d723783361be3546;hpb=c589cc94648320e13f826a27172b2058ac2bc539;p=osm%2Fdevops.git diff --git a/jenkins/template/start_build b/jenkins/template/start_build index 38f35b5b..2bd9074b 100755 --- a/jenkins/template/start_build +++ b/jenkins/template/start_build @@ -37,11 +37,25 @@ 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" RC=0