Skip to content
Snippets Groups Projects
.gitlab-ci.yml 10.5 KiB
Newer Older
stages:
    - build
Andrea Michelotti's avatar
Andrea Michelotti committed
    - deploy    
Andrea Michelotti's avatar
Andrea Michelotti committed
before_script:
  - export NOW=$(date +"%Y%m%d-%H%M%S")
  - export TAR_NAME_POSTFIX=$NOW
  - export SYS=`uname -s`
  - if [ "$SYS" == "Linux" ];then export NPROC=`nproc`;else export NPROC=4;fi
  - echo "[$CI_RUNNER_DESCRIPTION] $SYS $CI_JOB_NAME Working directory:$PWD tag $CI_COMMIT_REF_NAME CPUS:$NPROC"
Andrea Michelotti's avatar
Andrea Michelotti committed
  - export ARCH=`uname -m`
  - eval export `cat /etc/*-release|grep -e "^VERSION_ID="|tr -d "\" "`
  - eval export `cat /etc/*-release|grep -e "^ID="|tr -d "\" "`
Andrea Michelotti's avatar
Andrea Michelotti committed
  - export REV_POSTFIX=$CI_COMMIT_REF_NAME-$ID-$VERSION_ID-$ARCH
Andrea Michelotti's avatar
Andrea Michelotti committed
  - export DISTRIB_NAME=chaos-distrib-$REV_POSTFIX
  - export DISTRIB_PREFIX=/usr/local/chaos/chaos-distrib
  - export INSTALL_DIR=$DISTRIB_PREFIX
  - export CHAOS_MDS=localhost:5000
Andrea Michelotti's avatar
Andrea Michelotti committed
  - export CHAOS_INTERFACE=lo
Andrea Michelotti's avatar
Andrea Michelotti committed
  - export CHAOS_LIVE_SERVERS=couchbase
  - export CHAOS_DB_SERVERS=mongo
Andrea Michelotti's avatar
Andrea Michelotti committed
  - export PATH=/usr/local/chaos/qt-56/bin:$PATH
  - echo "Running on $ID $VERSION_ID $ARCH (distrib name '$DISTRIB_NAME')"
Andrea Michelotti's avatar
Andrea Michelotti committed
  - git config --global user.email andrea.michelotti@lnf.infn.it
  - git config --global user.name amichelo
  - git config --global color.ui true
macosx_x86_64:
Andrea Michelotti's avatar
Andrea Michelotti committed
   tags:
     - macosx
   stage: build
   services:
   - name: couchbase/server:community-3.1.3
     alias: couchbase
   - name: baltig.infn.it:4567/amichelo/chaos_bundle_compilation:mongo341
     alias: mongo
Andrea Michelotti's avatar
Andrea Michelotti committed

Andrea Michelotti's avatar
Andrea Michelotti committed
   script:
Andrea Michelotti's avatar
Andrea Michelotti committed
     - export CHAOS_LIVE_SERVERS=localhost
     - export CHAOS_DB_SERVERS=localhost
     - ./scripts/dbinit.sh localhost
Andrea Michelotti's avatar
Andrea Michelotti committed
     - curl http://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
     - chmod +x ~/bin/repo
     -  ~/bin/repo init -u git@baltig.infn.it:chaos-lnf-control/chaos_repo_bundle.git -b $CI_COMMIT_REF_NAME
     - mkdir chaos-osx10-distrib
     - ~/bin/repo sync
     - cmake -DCHAOS_WAN=ON . -DCMAKE_INSTALL_PREFIX=$PWD/chaos-osx10-distrib
     - make -j 4 install
Andrea Michelotti's avatar
Andrea Michelotti committed
     - cd $PWD/chaos-osx10-distrib
     - source chaos_env.sh
     - ./tools/chaos_test.sh .
Andrea Michelotti's avatar
Andrea Michelotti committed
     - tar cfz chaos-osx10-distrib.tar.gz chaos-osx10-distrib
   allow_failure: true
   artifacts:
         name: "chaos-osx10-distrib.tar.gz"
         paths:
Andrea Michelotti's avatar
Andrea Michelotti committed
            - ./*.tar.gz
Andrea Michelotti's avatar
Andrea Michelotti committed
         expire_in: 1 day
         when: always
ubuntu1604_x86_64:
  stage: build
Andrea Michelotti's avatar
Andrea Michelotti committed
  services:
  - name: couchbase/server:community-3.1.3
    alias: couchbase
  - name: baltig.infn.it:4567/amichelo/chaos_bundle_compilation:mongo341
Andrea Michelotti's avatar
Andrea Michelotti committed
    alias: mongo

  image: baltig.infn.it:4567/amichelo/chaos_bundle_compilation:1604
Andrea Michelotti's avatar
Andrea Michelotti committed
  script:
Andrea Michelotti's avatar
Andrea Michelotti committed
    - scripts/dbinit.sh couchbase
Andrea Michelotti's avatar
Andrea Michelotti committed
    - mkdir -p $INSTALL_DIR
    - repo init -u git@baltig.infn.it:chaos-lnf-control/chaos_repo_bundle.git -b $CI_COMMIT_REF_NAME
Andrea Michelotti's avatar
Andrea Michelotti committed
    - repo sync
    - cmake -DCHAOS_WAN=ON -DCHAOS_CCS=ON -DCERN_ROOT=$INSTALL_DIR -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -DCMAKE_BUILD_TYPE=PROFILE . |& tee $DISTRIB_PREFIX/bundle.configuration.log
Andrea Michelotti's avatar
Andrea Michelotti committed
    - make  -j 4 install
    - source $INSTALL_DIR/chaos_env.sh
Andrea Michelotti's avatar
Andrea Michelotti committed
    - $INSTALL_DIR/tools/chaos_test.sh -d $INSTALL_DIR/tools/test
    - cd chaosframework/ccs;qmake;echo "* compiling CCS";make -j 4 >& $DISTRIB_PREFIX/ccs.compilation.log ;cp ccs $INSTALL_DIR/bin;cd ../../
    - scripts/strip_symbols.sh $INSTALL_DIR
  artifacts:
        when: always
        name: "$DISTRIB_NAME.tar.gz"
        paths:
          - ./*.tar.gz
Andrea Michelotti's avatar
Andrea Michelotti committed
  after_script:
     - tar cfz $DISTRIB_NAME.tar.gz -C / $DISTRIB_PREFIX    
     - tar cfz test-log.$CI_JOB_NAME.$CI_RUNNER_DESCRIPTION.tar.gz -C /usr/local/chaos/chaos-distrib log etc
     - if scp test-log.$CI_JOB_NAME.$CI_RUNNER_DESCRIPTION.tar.gz chaosweb@opensource.lnf.infn.it:/var/www/html/binary/chaos/logs;then echo "* [$CI_RUNNER_DESCRIPTION] log transferred ok";else echo "%% [$CI_RUNNER_DESCRIPTION] cannot copy";fi

ubuntu1604_static_x86_64:
Andrea Michelotti's avatar
Andrea Michelotti committed
  tags:
    - chaos
  stage: build
  image: baltig.infn.it:4567/amichelo/chaos_bundle_compilation:1404
  script:
    - mkdir -p $INSTALL_DIR
    - repo init -u git@baltig.infn.it:chaos-lnf-control/chaos_repo_bundle.git -b $CI_COMMIT_REF_NAME
    - repo sync
    - cmake -DCHAOS_STATIC=ON -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR . |& tee $DISTRIB_PREFIX/bundle.configuration.log
    - make  -j 4 install |& tee $DISTRIB_PREFIX/bundle.compilation.log
Andrea Michelotti's avatar
Andrea Michelotti committed
    - /tmp/chaos_start.sh
Andrea Michelotti's avatar
Andrea Michelotti committed
    - source $INSTALL_DIR/chaos_env.sh
    - $INSTALL_DIR/tools/chaos_test.sh -d $INSTALL_DIR/tools/test
Andrea Michelotti's avatar
Andrea Michelotti committed
    - scripts/strip_symbols.sh $INSTALL_DIR
    - tar cfz $DISTRIB_NAME.static.tar.gz -C / $DISTRIB_PREFIX
  artifacts:
        name: "$DISTRIB_NAME.static.tar.gz"
        paths:
           - ./*.tar.gz
        expire_in: 1 day

ubuntu1404_x86_64:
  stage: build
  image: baltig.infn.it:4567/amichelo/chaos_bundle_compilation:1404
Andrea Michelotti's avatar
Andrea Michelotti committed
  services:
  - name: couchbase/server:community-3.1.3
    alias: couchbase
  - name: baltig.infn.it:4567/amichelo/chaos_bundle_compilation:mongo341
Andrea Michelotti's avatar
Andrea Michelotti committed
    alias: mongo

  script:
Andrea Michelotti's avatar
Andrea Michelotti committed
    - scripts/dbinit.sh couchbase
Andrea Michelotti's avatar
Andrea Michelotti committed
    - mkdir -p $INSTALL_DIR
    - repo init -u git@baltig.infn.it:chaos-lnf-control/chaos_repo_bundle.git -b $CI_COMMIT_REF_NAME
Andrea Michelotti's avatar
Andrea Michelotti committed
    - repo sync
    - cmake -DCHAOS_WAN=ON -DCHAOS_CCS=ON -DCERN_ROOT=$INSTALL_DIR -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR . 
Andrea Michelotti's avatar
Andrea Michelotti committed
    - make  -j 4 install
    - source $INSTALL_DIR/chaos_env.sh
Andrea Michelotti's avatar
Andrea Michelotti committed
    - $INSTALL_DIR/tools/chaos_test.sh -d $INSTALL_DIR/tools/test
    - cd chaosframework/ccs;qmake;echo "* compiling CCS";make -j 4 >& $DISTRIB_PREFIX/ccs.compilation.log;cp ccs $INSTALL_DIR/bin;cd ../../
    - scripts/strip_symbols.sh $INSTALL_DIR
  artifacts:
        when: always
        name: "$DISTRIB_NAME.tar.gz"
        paths:
Andrea Michelotti's avatar
Andrea Michelotti committed
  after_script:
     - tar cfz $DISTRIB_NAME.tar.gz -C / $DISTRIB_PREFIX    
     - tar cfz test-log.$CI_JOB_NAME.$CI_RUNNER_DESCRIPTION.tar.gz -C /usr/local/chaos/chaos-distrib log
     - if scp test-log.$CI_JOB_NAME.$CI_RUNNER_DESCRIPTION.tar.gz chaosweb@opensource.lnf.infn.it:/var/www/html/binary/chaos/logs;then echo "* [$CI_RUNNER_DESCRIPTION] log transferred ok";else echo "%% [$CI_RUNNER_DESCRIPTION] cannot copy";fi
Andrea Michelotti's avatar
Andrea Michelotti committed
     
build_arm_linux26:
  stage: build
Andrea Michelotti's avatar
Andrea Michelotti committed
  image: baltig.infn.it:4567/amichelo/chaos_bundle_compilation:lite
Andrea Michelotti's avatar
Andrea Michelotti committed
  script:
    - export PATH=/usr/local/chaos/i686-nptl-linux-gnu/bin/:$PATH
    - export DISTRIB_NAME=chaos-distrib-$CI_COMMIT_REF_NAME-$CI_JOB_NAME
    - export INSTALL_DIR=/builds/amichelo/chaos_bundle_compilation/distrib/$DISTRIB_NAME
    - mkdir -p $INSTALL_DIR
    - repo init -u git@baltig.infn.it:chaos-lnf-control/chaos_repo_bundle.git -b $CI_COMMIT_REF_NAME
Andrea Michelotti's avatar
Andrea Michelotti committed
    - repo sync
    - export PATH=/usr/local/chaos/gcc-arm-infn-linux26/bin/:$PATH
    - cmake . -DCHAOS_STATIC=ON -DCHAOS_TARGET=arm-linux-2.6 -DCHAOS_CDS=OFF -DCHAOS_MDS=OFF -DCHAOS_WAN=OFF -DCHAOS_EXAMPLES=OFF -DCHAOS_ENABLE_C11=OFF -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR
Andrea Michelotti's avatar
Andrea Michelotti committed
    - make  -j 4 install |& tee $INSTALL_DIR/bundle.compilation.log
Andrea Michelotti's avatar
Andrea Michelotti committed
    - arm-infn-linux-gnueabi-strip `find $INSTALL_DIR/bin/ -type f`
    - arm-infn-linux-gnueabi-strip `find $INSTALL_DIR/lib/ -name "*.a" -type f`
    - tar cfz $DISTRIB_NAME.tar.gz -C $INSTALL_DIR/..  $DISTRIB_NAME
  artifacts:
        name: "$DISTRIB_NAME.tar.gz"
build_i686_static_linux26:
Andrea Michelotti's avatar
Andrea Michelotti committed
  tags:
    - chaos
  stage: build
Andrea Michelotti's avatar
Andrea Michelotti committed
  image: baltig.infn.it:4567/amichelo/chaos_bundle_compilation:lite
    - repo init -u git@baltig.infn.it:chaos-lnf-control/chaos_repo_bundle.git -b $CI_COMMIT_REF_NAME
    - repo sync
    - export PATH=/usr/local/chaos/i686-nptl-linux-gnu/bin/:$PATH
    - export DISTRIB_NAME=chaos-distrib-$CI_COMMIT_REF_NAME-$CI_JOB_NAME
    - export INSTALL_DIR=/builds/amichelo/chaos_bundle_compilation/distrib/$DISTRIB_NAME
    - mkdir -p $INSTALL_DIR
Andrea Michelotti's avatar
Andrea Michelotti committed
    - cmake . -DCHAOS_STATIC=ON -DCHAOS_TARGET=i686-linux26 -DCHAOS_CDS=OFF -DCHAOS_MDS=OFF -DCHAOS_WAN=OFF -DCHAOS_EXAMPLES=OFF -DCHAOS_ENABLE_C11=OFF -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR |& tee $INSTALL_DIR/bundle.configuration.log
Andrea Michelotti's avatar
Andrea Michelotti committed
    - make  -j 4 install |& tee $INSTALL_DIR/bundle.compilation.log
Andrea Michelotti's avatar
Andrea Michelotti committed
    - i686-nptl-linux-gnu-strip `find $INSTALL_DIR/bin/ -type f`
    - i686-nptl-linux-gnu-strip `find $INSTALL_DIR/lib/ -name "*.a" -type f`
    - tar cfz $DISTRIB_NAME.tar.gz -C $INSTALL_DIR/..  $DISTRIB_NAME
  artifacts:
        name: "$DISTRIB_NAME.tar.gz"
           - ./*.tar.gz
build_i686_dynamic_linux26:
  stage: build
Andrea Michelotti's avatar
Andrea Michelotti committed
  image: baltig.infn.it:4567/amichelo/chaos_bundle_compilation:lite
    - export DISTRIB_NAME=chaos-distrib-$CI_COMMIT_REF_NAME-$CI_JOB_NAME
    - export INSTALL_DIR=/builds/amichelo/chaos_bundle_compilation/distrib/$DISTRIB_NAME
    - mkdir -p $INSTALL_DIR
    - repo init -u git@baltig.infn.it:chaos-lnf-control/chaos_repo_bundle.git -b $CI_COMMIT_REF_NAME
    - repo sync
    - export PATH=/usr/local/chaos/i686-nptl-linux-gnu/bin/:$PATH
Andrea Michelotti's avatar
Andrea Michelotti committed
    - cmake . -DCHAOS_TARGET=i686-linux26 -DCHAOS_CDS=OFF -DCHAOS_MDS=OFF -DCHAOS_WAN=OFF -DCHAOS_EXAMPLES=OFF -DCHAOS_ENABLE_C11=OFF -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR |& tee $INSTALL_DIR/bundle.configuration.log
Andrea Michelotti's avatar
Andrea Michelotti committed
    - make  -j 4 install|& tee $INSTALL_DIR/bundle.compilation.log
    - tar cfz $DISTRIB_NAME.tar.gz -C $INSTALL_DIR/..  $DISTRIB_NAME
  artifacts:
        name: "$DISTRIB_NAME.tar.gz"
           - ./*.tar.gz
  tags:
    - chaos
  stage: deploy
Andrea Michelotti's avatar
Andrea Michelotti committed
  image: baltig.infn.it:4567/amichelo/chaos_bundle_compilation:lite
  script:
    - scripts/accept_merge_request.sh $CI_COMMIT_REF_NAME
    - if [ -e chaos-osx10-distrib.tar.gz ];then scp chaos-osx10-distrib.tar.gz chaosweb@opensource.lnf.infn.it:/var/www/html/binary/chaos/$ARCH/osx/;fi
    - scp chaos-distrib-$CI_COMMIT_REF_NAME-ubuntu-16.04-x86_64.tar.gz chaosweb@opensource.lnf.infn.it:/var/www/html/binary/chaos/$ARCH/ubuntu1604
    - scp chaos-distrib-$CI_COMMIT_REF_NAME-ubuntu-16.04-x86_64.static.tar.gz chaosweb@opensource.lnf.infn.it:/var/www/html/binary/chaos/$ARCH/ubuntu1604    
    - scp chaos-distrib-$CI_COMMIT_REF_NAME-ubuntu-14.04-x86_64.tar.gz chaosweb@opensource.lnf.infn.it:/var/www/html/binary/chaos/$ARCH/ubuntu1404
    - scp chaos-distrib-$CI_COMMIT_REF_NAME-build_arm_linux26.tar.gz chaosweb@opensource.lnf.infn.it:/var/www/html/binary/chaos/arm/
    - scp chaos-distrib-$CI_COMMIT_REF_NAME-build_i686_static_linux26.tar.gz chaosweb@opensource.lnf.infn.it:/var/www/html/binary/chaos/i686/
    - scp chaos-distrib-$CI_COMMIT_REF_NAME-build_i686_dynamic_linux26.tar.gz chaosweb@opensource.lnf.infn.it:/var/www/html/binary/chaos/i686/
    - if [ $CI_COMMIT_REF_NAME == "development" ];then echo "deploying in LNF development infrastructure"; tar xfz $DISTRIB_NAME.tar.gz -C /;cd $DISTRIB_PREFIX;source chaos_env.sh;./tools/chaos_deploy.sh tools/config/lnf/test/chaos-infrastructure.txt;fi    
  allow_failure: true