.gitlab-ci.yml 2.69 KB
Newer Older
1 2
# Definition of global variables (all stages)
variables:
3
  PYTHONUNBUFFERED: "1"
4 5 6 7 8 9
  CONDA_ROOT: "${CI_PROJECT_DIR}/miniconda"


# Definition of our build pipeline order
stages:
  - build
André Anjos's avatar
André Anjos committed
10
  - deploy
11
  - pypi
12 13 14


# Build targets
15
.build_template:
16
  stage: build
17 18 19
  artifacts:
    expire_in: 1 week
  cache:
20 21 22 23
    paths:
      - miniconda.sh


24
build_linux:
25
  extends: .build_template
26 27
  variables:
    BUILD_EGG: "true"
28 29 30
  tags:
    - docker
  image: continuumio/conda-concourse-ci
André Anjos's avatar
André Anjos committed
31
  before_script:
32
    - rm -f /root/.condarc
33
    - rm -rf /root/.conda
34 35 36 37 38
  script:
    - python3 ./bob/devtools/bootstrap.py -vv build
    - source ${CONDA_ROOT}/etc/profile.d/conda.sh
    - conda activate base
    - python3 ./bob/devtools/build.py -vv --twine-check
39 40
  artifacts:
    paths:
41 42
      - dist/*.zip
      - sphinx
43 44
      - ${CONDA_ROOT}/conda-bld/linux-64/*.conda
      - ${CONDA_ROOT}/conda-bld/noarch/*.conda
45
      - ${CONDA_ROOT}/conda-bld/linux-64/*.tar.bz2
46
      - ${CONDA_ROOT}/conda-bld/noarch/*.tar.bz2
47 48 49 50
  cache:
    key: "linux-cache"


51
build_macosx:
52
  extends: .build_template
53 54
  tags:
    - macosx
55 56 57 58 59
  script:
    - python3 ./bob/devtools/bootstrap.py -vv build
    - source ${CONDA_ROOT}/etc/profile.d/conda.sh
    - conda activate base
    - python3 ./bob/devtools/build.py -vv
60 61
  artifacts:
    paths:
62 63
      - ${CONDA_ROOT}/conda-bld/osx-64/*.conda
      - ${CONDA_ROOT}/conda-bld/noarch/*.conda
64
      - ${CONDA_ROOT}/conda-bld/osx-64/*.tar.bz2
65
      - ${CONDA_ROOT}/conda-bld/noarch/*.tar.bz2
66 67 68 69
  cache:
    key: "macosx-cache"


André Anjos's avatar
André Anjos committed
70
# Deploy targets
71
.deploy_template:
André Anjos's avatar
André Anjos committed
72
  stage: deploy
André Anjos's avatar
André Anjos committed
73
  before_script:
74
    - rm -f /root/.condarc
75
    - rm -rf /root/.conda
André Anjos's avatar
André Anjos committed
76
  script:
77
    - python3 ./bob/devtools/bootstrap.py -vv local base
André Anjos's avatar
André Anjos committed
78
    - source ${CONDA_ROOT}/etc/profile.d/conda.sh
79 80
    - conda activate base
    - bdt ci base-deploy -vv
81
    - bdt ci deploy -vv
82
    - bdt ci clean -vv
André Anjos's avatar
André Anjos committed
83
  dependencies:
84 85
    - build_linux
    - build_macosx
André Anjos's avatar
André Anjos committed
86
  tags:
87
    - docker
88
  cache:
André Anjos's avatar
André Anjos committed
89 90 91 92 93
    paths:
      - miniconda.sh


deploy_beta:
94
  extends: .deploy_template
André Anjos's avatar
André Anjos committed
95 96 97 98 99 100
  environment: beta
  only:
    - master


deploy_stable:
101
  extends: .deploy_template
André Anjos's avatar
André Anjos committed
102 103 104 105 106
  environment: stable
  only:
    - /^v\d+\.\d+\.\d+([abc]\d*)?$/  # PEP-440 compliant version (tags)
  except:
    - branches
107 108 109 110 111 112 113 114 115


pypi:
  stage: pypi
  environment: pypi
  only:
    - /^v\d+\.\d+\.\d+([abc]\d*)?$/  # PEP-440 compliant version (tags)
  except:
    - branches
André Anjos's avatar
André Anjos committed
116
  before_script:
117
    - rm -f /root/.condarc
118
    - rm -rf /root/.conda
119
  script:
120
    - python3 ./bob/devtools/bootstrap.py -vv local base
121
    - source ${CONDA_ROOT}/etc/profile.d/conda.sh
122
    - conda activate base
123
    - bdt ci pypi -vv dist/*.zip
124
    - bdt ci clean -vv
125
  dependencies:
126 127
    - build_linux
    - build_macosx
128 129
  tags:
    - docker
130
  cache:
131 132
    paths:
      - miniconda.sh