.gitlab-ci.yml 2.66 KB
Newer Older
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
1
2
# This build file uses template features from YAML so it is generic enough for
# any Bob project. Don't modify it unless you know what you're doing.
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
3

Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
4
5
6
# Definition of global variables (all stages)
variables:
  CONDA_ROOT: "${CI_PROJECT_DIR}/miniconda"
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
7

Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
8
9

# Definition of our build pipeline order
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
10
11
stages:
  - build
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
12
  - deploy
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
13
  - pypi
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
14
15


Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
16
# Build targets
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
17
18
19
.build_template: &build_job
  stage: build
  before_script:
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
20
    - mkdir _ci
21
    - curl --silent "https://gitlab.idiap.ch/bob/bob.admin/raw/master/gitlab/install.sh" > _ci/install.sh
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
22
    - chmod 755 _ci/install.sh
23
    - ./_ci/install.sh _ci master #installs ci support scripts
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
24
    - ./_ci/before_build.sh
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
25
  script:
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
26
    - ./_ci/build.sh
27
28
  after_script:
    - ./_ci/after_build.sh
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
29
  cache: &build_caches
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
30
    paths:
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
31
32
33
      - miniconda.sh
      - ${CONDA_ROOT}/pkgs/*.tar.bz2
      - ${CONDA_ROOT}/pkgs/urls.txt
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
34
35


Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
36
.build_linux_template: &linux_build_job
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
37
38
  <<: *build_job
  tags:
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
39
40
41
42
43
44
45
46
47
48
    - docker
  image: continuumio/conda-concourse-ci
  artifacts:
    expire_in: 1 week
    paths:
      - _ci/
      - ${CONDA_ROOT}/conda-bld/linux-64/*.tar.bz2
  cache:
    <<: *build_caches
    key: "linux-cache"
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
49
50


Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
51
.build_macosx_template: &macosx_build_job
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
52
  <<: *build_job
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
53
  tags:
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
54
55
56
57
58
59
60
61
62
    - macosx
  artifacts:
    expire_in: 1 week
    paths:
      - _ci/
      - ${CONDA_ROOT}/conda-bld/osx-64/*.tar.bz2
  cache:
    <<: *build_caches
    key: "macosx-cache"
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
63
64


Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
65
66
67
68
build_linux_27:
  <<: *linux_build_job
  variables:
    PYTHON_VERSION: "2.7"
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
69
70


71
build_linux_36:
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
72
73
  <<: *linux_build_job
  variables:
74
    PYTHON_VERSION: "3.6"
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
75
76
77
78
79
80
81
82
    BUILD_EGG: "true"
  artifacts:
    expire_in: 1 week
    paths:
      - _ci/
      - dist/*.zip
      - sphinx
      - ${CONDA_ROOT}/conda-bld/linux-64/*.tar.bz2
83
84


Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
85
build_macosx_27:
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
86
87
  <<: *macosx_build_job
  variables:
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
88
    PYTHON_VERSION: "2.7"
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
89

Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
90
91
92
93
94
95
96
97
98
99
100

build_macosx_36:
  <<: *macosx_build_job
  variables:
    PYTHON_VERSION: "3.6"


# Deploy targets
.deploy_template: &deploy_job
  stage: deploy
  before_script:
101
    - ./_ci/install.sh _ci master #updates ci support scripts
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
102
103
  script:
    - ./_ci/deploy.sh
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
104
  dependencies:
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
105
106
    - build_linux_27
    - build_linux_36
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
107
    - build_macosx_27
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
108
    - build_macosx_36
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
109
  tags:
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
110
    - deployer
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
111
112


Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
113
114
115
116
117
deploy_beta:
  <<: *deploy_job
  environment: beta
  only:
    - master
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
118
119


Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
120
121
122
123
124
125
126
deploy_stable:
  <<: *deploy_job
  environment: stable
  only:
    - /^v\d+\.\d+\.\d+([abc]\d*)?$/  # PEP-440 compliant version (tags)
  except:
    - branches
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
127
128


Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
129
130
131
132
133
134
135
136
pypi:
  stage: pypi
  environment: pypi
  only:
    - /^v\d+\.\d+\.\d+([abc]\d*)?$/  # PEP-440 compliant version (tags)
  except:
    - branches
  before_script:
137
    - ./_ci/install.sh _ci master #updates ci support scripts
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
138
139
  script:
    - ./_ci/pypi.sh
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
140
  dependencies:
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
141
    - build_linux_36
Tiago de Freitas Pereira's avatar
Tiago de Freitas Pereira committed
142
  tags:
Amir MOHAMMADI's avatar
Amir MOHAMMADI committed
143
    - deployer