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

stages:
  - build
  - test
  - deploy

build:
  stage: build
  script:
    - env
    - sh ${HOME}/build-install-ngx-voms.sh
    - mv ${HOME}/local local
  artifacts:
    paths:
      - local

buildc:
  stage: build
  script:
    - env
    - sh ${HOME}/build-install-ngx-voms.sh -d -c
    - mv ${HOME}/local localc
  artifacts:
    paths:
      - localc

test:
  stage: test
  dependencies:
    - build
  script:
    - rm -rf ${HOME}/local/
    - mv local ${HOME}
    - sh test-ngx-voms.sh

testc:
  stage: test
  dependencies:
    - buildc
  script:
    - rm -rf ${HOME}/local/
    - mv localc local
    - mv local ${HOME}
    - sh test-ngx-voms.sh
    - sh cov-ngx-voms.sh
    - mv cov coverage
  artifacts:
    paths:
      - coverage

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