.gitlab-ci.yml 2.61 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
  tags:
    - docker
30
  image: docker.idiap.ch/bob/docker-images/c3i-linux-64
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
      - ${CONDA_ROOT}/conda-bld/osx-64/*.conda
63 64 65 66 67
      - ${CONDA_ROOT}/conda-bld/osx-64/*.tar.bz2
  cache:
    key: "macosx-cache"


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


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


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


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
114
  before_script:
115
    - rm -f /root/.condarc
116
    - rm -rf /root/.conda
117
  script:
118
    - python3 ./bob/devtools/bootstrap.py -vv local base
119
    - source ${CONDA_ROOT}/etc/profile.d/conda.sh
120
    - conda activate base
121
    - bdt ci pypi -vv dist/*.zip
122
    - bdt ci clean -vv
123
  dependencies:
124 125
    - build_linux
    - build_macosx
126 127
  tags:
    - docker
128
  cache:
129 130
    paths:
      - miniconda.sh