Skip to content
Snippets Groups Projects
.gitlab-ci.yml 9.05 KiB
image: eicweb.phy.anl.gov:4567/eic/juggler/juggler:latest

workflow:
  rules:
    - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
    - if: '$CI_PIPELINE_SOURCE == "web"'
    - if: '$CI_PIPELINE_SOURCE == "webide"'
    - if: '$CI_COMMIT_BRANCH == "master"'
    - if: '$CI_COMMIT_BRANCH == "acadia"'
    - if: '$CI_COMMIT_TAG'

default:
  before_script:
    - source .local/bin/env.sh
  artifacts:
    expire_in: 1 week 
    paths:
      - .local/detector
      - .local/lib
      - .local/bin
      - .local/include
      - .local/share
      - results
      - config
      - images
      - doc
      - juggler.env
      - geo
    reports:
      dotenv: juggler.env

stages:
  - config
  - build
  - test
  - docs
  - collect
  - finalize 
  - deploy

common:setup:
  stage: config
  rules:
    - if: '$CI_SERVER_HOST == "eicweb.phy.anl.gov"' 
  before_script:
    - git clone https://eicweb.phy.anl.gov/EIC/benchmarks/common_bench.git setup 
  script:
    - export JUGGLER_DETECTOR="athena"
    - |
      #      if [[ "x${CI_PIPELINE_SOURCE}" == "xmerge_request_event"  || "$CI_COMMIT_BRANCH" == "master" ]]; then
        export JUGGLER_DETECTOR_VERSION="${CI_COMMIT_REF_NAME}"
        echo "BEAMLINE_CONFIG          = ${BEAMLINE_CONFIG}"
        echo "BEAMLINE_CONFIG_VERSION  = ${BEAMLINE_CONFIG_VERSION}"
        echo "JUGGLER_DETECTOR         = ${JUGGLER_DETECTOR}"
        echo "JUGGLER_DETECTOR_VERSION = ${CI_COMMIT_REF_NAME}"
        echo "JUGGLER_DETECTOR_VERSION=$CI_COMMIT_REF_NAME" >> juggler.env
        echo "JUGGLER_DETECTOR=$JUGGLER_DETECTOR" >> juggler.env
        #fi
    - source setup/bin/env.sh && ./setup/bin/install_common.sh

common:detector:
  stage: build
  needs: 
    - common:setup
  script:
    #- source .local/bin/env.sh && build_detector.sh
    - build_detector.sh
    - mkdir -p results
    - mkdir -p config
    - mkdir -p doc