image: eicweb.phy.anl.gov:4567/containers/eic_container/eic:latest

default:
  artifacts:
    expire_in: 10 mins
    paths:
      - config/
      - results/
      - sim_output/
      - data
        #    exclude:
        #      - .git/
        #      - datasets/.git/
        #before_script:
        #  - git clone https://eicweb.phy.anl.gov/EIC/NPDet.git
        #      #    - cd NPDet/build && cmake ../. -DCMAKE_INSTALL_PREFIX=/usr/local && make -j10 && make install
        #      #    - cd ../.. 

stages:
  - build
  - data_init

get_data:
  stage: data_init
  tags:
    - sodium
  script:
    - git clone https://eicweb.phy.anl.gov/EIC/datasets.git datasets
    - mkdir -p data
    - mkdir -p results
    - mkdir -p sim_output

generate_config:
  dependencies: ["get_data"]
  tags:
    - sodium
  script:
    - mkdir -p config && ./bin/gen_ci_config -p test_ -i dummy > config/dummy_config.yml
    - mkdir -p config && ./bin/gen_ci_config --no-failure -p dis_ -i dis > config/dis_config.yml

dummy-pipeline:
  dependencies: ["generate_config"]
  trigger:
    include:
      - artifact: config/dummy_config.yml
        job: generate_config
    strategy: depend

dis-pipeline:
  dependencies: ["generate_config"]
  trigger:
    include:
      - artifact: config/dis_config.yml
        job: generate_config
    strategy: depend

final_report:
  tags:
    - sodium
  dependencies: ["dis-pipeline","dummy-pipeline"]
  script:
    - echo "It was a success!"

