diff --git a/openbis_all/source/bash/build/tag.sh b/openbis_all/source/bash/build/tag.sh index 528030172932a33c4080a887d46223b213d11af5..09c7ee7ea825ff8334ea656fcc61c510ee3880ee 100755 --- a/openbis_all/source/bash/build/tag.sh +++ b/openbis_all/source/bash/build/tag.sh @@ -5,29 +5,31 @@ if [ $# -ne 2 ] then echo "Usage: ./tag.sh [branch] [tag]" echo "" - echo "Example: ./tag.sh release/13.04.x 13.04.1" + echo "Example: ./tag.sh 13.04.x 13.04.1" exit 1 fi branch=$1 -dir=${2%/*} -if [ $dir == $2 ]; then - dir=$branch - tag=$1/$2 -else - tag=$2 -fi +tag=$2 + +# cd to repository root directory +cd "$(dirname "$0")/../../../.." -svn info svn+ssh://svncisd.ethz.ch/repos/cisd/openbis_all/branches/$branch 2>/dev/null +# switch to branch - exit if it does not exist +git checkout $branch if [ $? -ne 0 ]; then echo "Branch does not exist!"; exit 1; fi +git pull -svn info svn+ssh://svncisd.ethz.ch/repos/cisd/openbis_all/tags/$tag 2>/dev/null +# exit if tag already exists +git checkout $tag if [ $? -eq 0 ]; then echo "Tag already exists!"; exit 1; fi -svn mkdir --parents svn+ssh://svncisd.ethz.ch/repos/cisd/openbis_all/tags/$dir -m "create tag $tag" -svn copy svn+ssh://svncisd.ethz.ch/repos/cisd/openbis_all/branches/$branch svn+ssh://svncisd.ethz.ch/repos/cisd/openbis_all/tags/$tag -m "create tag $tag" -rm -rf elntemp -svn co --depth=immediates svn+ssh://svncisd.ethz.ch/repos/cisd/openbis_all/tags/$tag/openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html elntemp -svn info svn+ssh://svncisd.ethz.ch/repos/cisd/openbis_all/tags/$tag|grep Path|awk -F: '{print $2}'|sed -e 's/ //g' > elntemp/version.txt -svn add elntemp/version.txt -svn commit elntemp -m "Added ELN build info to tag $tag" \ No newline at end of file +# set version for ELN +echo $tag > openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/version.txt +git add openbis_standard_technologies/dist/core-plugins/eln-lims/1/as/webapps/eln-lims/html/version.txt +git commit -m "Added ELN build info to tag $tag" +git push + +# create tag +git tag $tag +git push origin $tag diff --git a/openbis_all/source/bash/tag_and_build_sprint.sh b/openbis_all/source/bash/tag_and_build_sprint.sh index 0718b1b8dba0a14c1874d5db74ad859cadaff81a..3a36ec98fe31dbaa16d8f8185e0f638a194538ae 100755 --- a/openbis_all/source/bash/tag_and_build_sprint.sh +++ b/openbis_all/source/bash/tag_and_build_sprint.sh @@ -11,6 +11,8 @@ usage() exit 1 } +# parameter checks + if [ $# -eq 0 ] then usage @@ -35,13 +37,14 @@ then usage fi +# create sprint branch if [ ${HOT_FIX_NUMBER} -eq 0 ] then - "$BIN_DIR/build/branch.sh" sprint/S${1}.x + "$BIN_DIR/build/branch.sh" S${1}.x if [ $? -ne 0 ];then exit 1; fi fi -"$BIN_DIR/build/tag.sh" sprint/S${1}.x S${1}.${HOT_FIX_NUMBER} +"$BIN_DIR/build/tag.sh" S${1}.x S${1}.${HOT_FIX_NUMBER} if [ $? -ne 0 ];then exit 1; fi -"$BIN_DIR/build/build.sh" sprint/S${1}.x S${1}.${HOT_FIX_NUMBER} \ No newline at end of file +"$BIN_DIR/build/build.sh" S${1}.x S${1}.${HOT_FIX_NUMBER}