image: eicweb.phy.anl.gov:4567/whit/image_recipes/root_base:latest

stages:
  - build
  - build_sing_img
  - data_replays
  - data_tests

hcana_docker:
  stage: build  
  tags: 
     - eic0 docker
  script:
     - docker login eicweb.phy.anl.gov -u whit -p ${CI_IMAGE_BUILD_PAT}
     - cd containers/docker && make release

hcana_singularity:
  tags: 
     - singularity
  stage: build_sing_img
  #when: manual
  dependencies:
     - hcana_docker
  script:
     - /bin/bash .gitlabci/setup.sh
     - mkdir -p build
     - pwd
     - cp containers/singularity/Singularity Singularity.hcana
     - cp Singularity.hcana build/.
     - /bin/bash .gitlabci/build.sh Singularity.hcana
     - cp Singularity.hcana.simg build/.
  artifacts:
      paths:
        - build/Singularity.hcana
        - build/Singularity.hcana.simg

elastic_replay:
  when: manual
  tags: 
     - eic0 docker
  stage: data_replays
  dependencies: 
     - hcana_singularity
  script:
     - bash tests/replay_elastic_data.sh
  artifacts:
     paths: 
       - ROOTfiles/*
       - build/Singularity.hcana
       - build/Singularity.hcana.simg


elastic_test1:
  when: manual
  tags: 
     - eic0 docker
  stage: data_tests
  dependencies: 
     - elastic_replay
  script:
     - bash tests/elastic_test.sh

elastic_test2:
  when: manual
  tags: 
     - eic0 docker
  stage: data_tests
  dependencies: 
     - elastic_replay
  script:
     - bash tests/elastic_test2.sh


