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

#docker pull eicweb.phy.anl.gov:4567/whit/image_recipes/ubuntu_base:latest 

stages:
  - build
  - phase2


hcana_docker:
  stage: build  
  tags: 
     - eic0 docker
  script:
     - docker login eicweb.phy.anl.gov:4567 -u whit -p ${CI_IMAGE_BUILD_PAT}
     - cd containers/docker && make release
       #- docker push eicweb.phy.anl.gov:4567/jlab/hcana
       # - docker login eicweb.phy.anl.gov:4567 -u whit -p ${eic0_registry_push_token}
       # - docker tag  whit/image_recipes/ubuntu_base:latest eicweb.phy.anl.gov:4567/whit/image_recipes/ubuntu_base:latest
       # - docker push eicweb.phy.anl.gov:4567/whit/image_recipes/ubuntu_base:latest


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


