.gitlab-ci.yml 2.05 KB
Newer Older
1 2 3
---
image: docker:latest

Duncan Macleod's avatar
Duncan Macleod committed
4 5 6
stages:
  - test
  - build
7 8
  - docs
  - deploy
Duncan Macleod's avatar
Duncan Macleod committed
9

10
variables:
Duncan Macleod's avatar
Duncan Macleod committed
11
  CVMFS_BASE_DIR: "/cvmfs/ligo-containers.opensciencegrid.org/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}"
12 13
  DOCKER_DRIVER: overlay
  TAG: $CI_REGISTRY_IMAGE:latest
14
  NIGHTLY: $CI_REGISTRY_IMAGE:nightly
Duncan Macleod's avatar
Duncan Macleod committed
15
  PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
16

Duncan Macleod's avatar
Duncan Macleod committed
17 18 19
before_script:
  - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY

Duncan Macleod's avatar
Duncan Macleod committed
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
test-macos:
  tags:
    - macos_highsierra
  stage: test
  variables:
    INSTALL_PATH: "${CI_PROJECT_DIR}/miniconda"
  only:
    - master
    - merge_requests
    - schedules
  before_script: []
  script:
    - curl -o ./miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
    - /bin/bash miniconda.sh -b -p ${INSTALL_PATH}
    - source ${INSTALL_PATH}/etc/profile.d/conda.sh
    - conda update --yes conda
    - conda env create -f environment-py27.yml
    - conda env create -f environment-py36.yml
    - conda env create -f environment-py37.yml

test-linux:
Duncan Macleod's avatar
Duncan Macleod committed
41
  stage: test
42
  only:
Duncan Macleod's avatar
Duncan Macleod committed
43 44
    - merge_requests
  script:
45
    - docker build --pull --tag ${CI_REGISTRY_IMAGE}:test --build-arg INSTALL_PATH=/opt/conda .
Duncan Macleod's avatar
Duncan Macleod committed
46 47 48 49 50

build-latest:
  stage: build
  only:
    - master
51
  script:
Duncan Macleod's avatar
Duncan Macleod committed
52
    - docker build --no-cache --pull -t $TAG --build-arg INSTALL_PATH=${CVMFS_BASE_DIR}/latest .
53
    - docker push $TAG
Duncan Macleod's avatar
Duncan Macleod committed
54 55 56 57 58 59 60

build-nightly:
  stage: build
  only:
    - schedules
  script:
    - docker build --no-cache --pull -t $NIGHTLY -f Dockerfile-singularity .
61
    - docker push $NIGHTLY
Duncan Macleod's avatar
Duncan Macleod committed
62 63 64 65

# -- documentation

docs:
66 67 68
  stage: docs
  dependencies:
    - build-latest
Duncan Macleod's avatar
Duncan Macleod committed
69
  only:
Duncan Macleod's avatar
Duncan Macleod committed
70
    - schedules
Duncan Macleod's avatar
Duncan Macleod committed
71
  before_script:
72 73
    # install python
    - apk add python3
Duncan Macleod's avatar
Duncan Macleod committed
74
    - export LSCSOFT_CONDA_DOCKER_IMAGE="${NIGHTLY}"
75
    - python3 -m pip install -r docs/requirements.txt
Duncan Macleod's avatar
Duncan Macleod committed
76
  script:
Duncan Macleod's avatar
Duncan Macleod committed
77
    - cd docs
78
    - python3 -m sphinx -M html . ../build/sphinx -vv
Duncan Macleod's avatar
Duncan Macleod committed
79 80 81 82 83 84 85 86
  artifacts:
    paths:
      - build/sphinx/html
  cache:
    paths:
      - .cache/pip

pages:
87
  stage: deploy
Duncan Macleod's avatar
Duncan Macleod committed
88 89 90
  dependencies:
    - docs
  only:
Duncan Macleod's avatar
Duncan Macleod committed
91
    - schedules
Duncan Macleod's avatar
Duncan Macleod committed
92 93 94 95 96
  script:
    - mv build/sphinx/html public
  artifacts:
    paths:
      - public