diff --git a/openbis_all/source/bash/build/branch.sh b/openbis_all/source/bash/build/branch.sh index 35029ece38d40962653ee847f55246e77f8ccc4c..8c7a191dd217b8437f776adb3fddff3139513c99 100755 --- a/openbis_all/source/bash/build/branch.sh +++ b/openbis_all/source/bash/build/branch.sh @@ -1,6 +1,6 @@ #!/bin/bash - +# exit if no parameter given if [ $# -ne 1 ] then echo "Usage: ./branch.sh [branch]" @@ -9,62 +9,23 @@ then exit 1 fi -svn info svn+ssh://svncisd.ethz.ch/repos/cisd/openbis_all/branches/$1 2>/dev/null -if [ $? -eq 0 ]; then echo "Branch already exists!"; exit 1; fi - - -ALL_PROJECTS="\ -gradle \ -authentication \ -build_resources \ -commonbase \ -common \ -datamover \ -datastore_server \ -dbmigration \ -deep_sequencing_unit \ -eu_agronomics \ -eu_basynthec \ -eu_basysbio \ -image_readers \ -installation \ -integration-tests \ -js-test \ -libraries \ -openbis \ -openbis_all \ -openbis_api \ -openbis_mobile \ -openbis_oai_pmh \ -openbis_standard_technologies \ -openbis-common \ -plasmid \ -rtd_cina \ -rtd_phosphonetx \ -rtd_yeastx \ -sanofi \ -screening \ -ui-test\ -" - -rm -rf tmp - -svn mkdir --parents svn+ssh://svncisd.ethz.ch/repos/cisd/openbis_all/branches/$1 -m "create branch $1"; -svn co svn+ssh://svncisd.ethz.ch/repos/cisd/openbis_all/branches/$1 tmp - -for project in $ALL_PROJECTS; do - svn copy svn+ssh://svncisd.ethz.ch/repos/cisd/$project/trunk tmp/$project -done - -cd tmp -svn commit -m "create branch $1" -cd .. +# exit if branch already exists +branch_heads=`git ls-remote --heads git@sissource.ethz.ch:sis/openbis.git $1` +if [ -n "$branch_heads" ]; then + echo "Branch already exists!" + exit 1 +fi -rm -rf tmp -mkdir -p tmp +# cd to repository root directory +cd "$(dirname "$0")/../../../.." -svn checkout --depth=immediates svn+ssh://svncisd.ethz.ch/repos/cisd/openbis_all/branches/$1 tmp; +# create branch in git from master +git checkout master +git pull +git checkout -b $1 +git push -u origin $1 +# fix dependency versions GRADLE_PROJECTS="\ authentication \ commonbase \ @@ -87,14 +48,8 @@ screening \ ui-test\ " -for project in $GRADLE_PROJECTS gradle; do - cd tmp/$project; - svn update gradlew gradle build.gradle settings.gradle javaproject.gradle repository.gradle gwtdev.gradle query-api.gradle proteomics-api.gradle screening-api.gradle admin-console.gradle clients.gradle; - cd ../..; -done - for project in $GRADLE_PROJECTS; do - cd tmp/$project; + cd $project; ./gradlew dependencyReport; cat targets/gradle/reports/project/dependencies.txt|egrep ^.---|grep \>|sort|uniq|awk '{print $2 ":" $4}'|awk -F: '{print "s/" $1 ":" $2 ":" $3 "/" $1 ":" $2 ":" $4 "/g"}' > sed_commands; @@ -106,9 +61,10 @@ for project in $GRADLE_PROJECTS; do done rm sed_commands - cd ../..; + cd ..; done -cd tmp -svn commit -m "fixed dependencies of $1"; -cd .. +# commit dependency versions +git add --all +git commit -m "fixed dependencies of $1"; +git push