Skip to content
Snippets Groups Projects
build.sh 1.45 KiB
Newer Older
  • Learn to ignore specific revisions
  • #!/bin/sh
    usage()
    {
      echo ""
    
      echo "Usage: ./build.sh branch tag"
    
      echo "Example: ./build.sh S175.x S175.0"
    
    function move_to_file_server {
      echo "Moving new openBIS components to file server"
      
      OPENBIS_PATH=~openbis/fileserver/sprint_builds/openBIS
    
      SPRINT_DIR=$OPENBIS_PATH/$TODAY-$tag
    
      mkdir -p $SPRINT_DIR
    
      mv *$tag*.{zip,gz} $SPRINT_DIR/
    
      chmod g+w -R $SPRINT_DIR
    }
    
    
    Yves Noirjean's avatar
    Yves Noirjean committed
    if [ $# -ne 2 ]
    
    TODAY=`date "+%Y-%m-%d"`
    
    
    Yves Noirjean's avatar
    Yves Noirjean committed
    branch=$1
    tag=$2
    
    
    # cd to repository root directory
    cd "$(dirname "$0")/../../../.."
    
    # checkout tag
    git checkout $tag
    if [ $? -ne 0 ]; then echo "Tag does not exist!"; exit 1; fi
    
    # build
    cd openbis_standard_technologies
    
    ./gradlew :clientsAndApis -x test
    ./gradlew :generateJavadoc
    cd ../installation
    ./gradlew :build -x test
    cd ../plasmid
    ./gradlew :build -x test
    
    Yves Noirjean's avatar
    Yves Noirjean committed
    
    # move documentation to fileserver
    
    cp -r openbis/openbis_standard_technologies/targets/gradle/docs/javadoc ~openbis/fileserver/doc/openbis/$tag
    
    cd ~openbis/fileserver/doc/openbis
    
    if [ ${tag:0:1} == "S" ]; then
    
      ln -s $tag current
    
      dir=${tag%.*}
    
      ln -s $tag $dir
    
    Yves Noirjean's avatar
    Yves Noirjean committed
    # move components to fileserver
    mv openbis/openbis_standard_technologies/targets/gradle/distributions/openBIS-clients-and-APIs*.zip .
    mv openbis/installation/targets/gradle/distributions/openBIS-installation-standard-technologies*.tar.gz .
    mv openbis/plasmid/targets/gradle/distributions/datastore_server_plugin-plasmid*.zip .
    
    
    move_to_file_server