# This file is a template, and might need editing before it works on your project.
# Official docker image.
image: storm2/ngx-voms-build:latest

stages:
  - build
  - test
  - deploy

build4c:
  stage: build
  script:
    - env
    - sh ${HOME}/build-install-ngx-voms.sh -d -c
    - mv ${HOME}/local local
    - mv ${HOME}/openresty-1.13.6.1/build/nginx-1.13.6 nginx-1.13.6
  artifacts:
    paths:
      - local
      - nginx-1.13.6

test4c:
  stage: test
  dependencies:
    - build4c
  script:
    - rm -rf ${HOME}/local/
    - rm -rf ${HOME}/openresty-1.13.6.1/build/nginx-1.13.6/
    - mv local ${HOME}
    - mv nginx-1.13.6 ${HOME}/openresty-1.13.6.1/build/
    - sh test-ngx-voms.sh
    - sh cov-ngx-voms.sh
    - mv /tmp/coverage-report coverage
  artifacts:
    paths:
      - coverage

pages:
  stage: deploy
  dependencies:
    - test4c
  script:
    - mv coverage/ public/
  artifacts:
    paths:
      - public
    expire_in: 30 days