variables:
  PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"

# Pip's cache doesn't store the python packages
# https://pip.pypa.io/en/stable/reference/pip_install/#caching
#
# If you want to also cache the installed packages, you have to install
# them in a virtualenv and cache it as well.
cache:
  paths:
    - .cache/pip
    - venv/
  key: "$CI_COMMIT_REF_SLUG"


stages:
    - build


.virtualenv_template: &virtualenv_definition |
  python -V
  pip install -U pip setuptools wheel
  pip install virtualenv
  virtualenv venv
  source venv/bin/activate
  pip install .

.junit_template: &junit_definition
    artifacts:
      reports:
        junit: "reports/junit*.xml"


build-jpp-12.1.0:
    image: docker.km3net.de/jpp:v12-1-0
    stage: build
    script:
        - yum install -y epel-release
        - yum install -y python-pip python-devel
        - _CWD=$(pwd) && cd /usr/local/root && source bin/thisroot.sh && cd $_CWD
        - which -a root
        - which -a python
        - python -c "import ROOT"
        - source /Jpp/setenv.sh /Jpp
        - *virtualenv_definition
