.gitlab-ci.yml 5.54 KB
Newer Older
Jamie Hall's avatar
Jamie Hall committed
1
stages:
2
  - docker_login
3
  - ci
4
  - deploy
eric pellegrini's avatar
eric pellegrini committed
5
  - docker_logout
6

7
8
9
10
11
12
13
14
15
docker_login:
  stage: docker_login
  script:
    - docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
  tags:
    - docker
    - sci
    - ubuntu
  
16
17
18
19
############################
# ubuntu trusty  pipeline
############################
ci:ubuntu_trusty:
20
21
  stage: ci
  script:
22
    - docker build --force-rm --build-arg MDANSE_GIT_COMMIT=${CI_COMMIT_SHA} --build-arg MDANSE_GIT_BRANCH_NAME=${CI_COMMIT_REF_NAME} -t ci_mdanse_trusty -f ${CI_PROJECT_DIR}/BuildServer/Docker/Builder/Ubuntu-trusty/Dockerfile_build .
23
24
25
26
27
28
29
30
31
  allow_failure: false
  tags:
    - docker
    - sci
    - ubuntu

deploy:ubuntu_trusty:
  stage: deploy
  script:
32
    - docker build --force-rm --build-arg MDANSE_GIT_BRANCH_NAME=${CI_COMMIT_REF_NAME} -t deploy_mdanse_trusty -f ${CI_PROJECT_DIR}/BuildServer/Docker/Builder/Ubuntu-trusty/Dockerfile_deploy .
33
    - chmod 755 ${CI_PROJECT_DIR}/BuildServer/Docker/upload_artefacts.sh
34
    - ${CI_PROJECT_DIR}/BuildServer/Docker/upload_artefacts.sh trusty
35
36
  dependencies:
    - ci:ubuntu_trusty
37
38
  allow_failure: false
  only:
39
    - master
40
    - develop
41
42
    - /^release-.*$/
    - /^hotfix-.*$/
43
    - tags
44
    - web
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
  when: on_success
  artifacts:
    paths:
    - ./*.deb
  tags:
    - docker
    - sci
    - ubuntu

############################
# ubuntu xenial  pipeline
############################
ci:ubuntu_xenial:
  stage: ci
  script:
60
    - docker build --force-rm --build-arg MDANSE_GIT_COMMIT=${CI_COMMIT_SHA} --build-arg MDANSE_GIT_BRANCH_NAME=${CI_COMMIT_REF_NAME} -t ci_mdanse_xenial -f ${CI_PROJECT_DIR}/BuildServer/Docker/Builder/Ubuntu-xenial/Dockerfile_build .
61
  allow_failure: false
62
63
64
65
66
67
68
69
  tags:
    - docker
    - sci
    - ubuntu

deploy:ubuntu_xenial:
  stage: deploy
  script:
70
    - docker build --force-rm --build-arg MDANSE_GIT_BRANCH_NAME=${CI_COMMIT_REF_NAME} -t deploy_mdanse_xenial -f ${CI_PROJECT_DIR}/BuildServer/Docker/Builder/Ubuntu-xenial/Dockerfile_deploy .
71
    - chmod 755 ${CI_PROJECT_DIR}/BuildServer/Docker/upload_artefacts.sh
72
    - ${CI_PROJECT_DIR}/BuildServer/Docker/upload_artefacts.sh xenial
73
74
  dependencies:
    - ci:ubuntu_xenial
75
76
  allow_failure: false
  only:
77
78
    - master
    - develop
79
80
    - /^release-.*$/
    - /^hotfix-.*$/
81
    - tags
82
    - web
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
  when: on_success
  artifacts:
    paths:
    - ./*.deb
  tags:
    - docker
    - sci
    - ubuntu

############################
# ubuntu bionic pipeline
############################
ci:ubuntu_bionic:
  stage: ci
  script:
98
    - docker build --force-rm --build-arg MDANSE_GIT_COMMIT=${CI_COMMIT_SHA} --build-arg MDANSE_GIT_BRANCH_NAME=${CI_COMMIT_REF_NAME} -t ci_mdanse_bionic -f ${CI_PROJECT_DIR}/BuildServer/Docker/Builder/Ubuntu-bionic/Dockerfile_build .
99
100
101
102
103
104
105
106
107
  allow_failure: false
  tags:
    - docker
    - sci
    - ubuntu

deploy:ubuntu_bionic:
  stage: deploy
  script:
108
    - docker build --force-rm --build-arg MDANSE_GIT_BRANCH_NAME=${CI_COMMIT_REF_NAME} -t deploy_mdanse_bionic -f ${CI_PROJECT_DIR}/BuildServer/Docker/Builder/Ubuntu-bionic/Dockerfile_deploy .
109
    - chmod 755 ${CI_PROJECT_DIR}/BuildServer/Docker/upload_artefacts.sh
110
    - ${CI_PROJECT_DIR}/BuildServer/Docker/upload_artefacts.sh bionic
111
112
113
114
115
  dependencies:
    - ci:ubuntu_bionic
  allow_failure: false
  only:
    - master
116
    - develop
117
118
    - /^release-.*$/
    - /^hotfix-.*$/
119
    - tags
120
    - web
121
  when: on_success
122
123
  artifacts:
    paths:
124
    - ${CI_PROJECT_DIR}/*.deb
125
  tags:
eric pellegrini's avatar
eric pellegrini committed
126
    - docker
127
128
    - sci
    - ubuntu
129

130
131
132
133
134
135
############################
# osx high sierra pipeline
############################
ci:osx:
  stage: ci
  script:
eric pellegrini's avatar
eric pellegrini committed
136
137
    - source ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/definitions.sh
    - source ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/version.sh
138
139
140
141
142
    - ${CI_PROJECT_DIR}/BuildServer/Unix/build.sh
    - ${CI_PROJECT_DIR}/BuildServer/Unix/tests.sh
  allow_failure: false
  artifacts:
    paths:
143
    - ${CI_PROJECT_DIR}/build
144
    expire_in: 1 hrs
145
146
147
148
149
150
151
  tags:
    - sci
    - osx-10.13

deploy:osx:
  stage: deploy
  script:
eric pellegrini's avatar
eric pellegrini committed
152
153
154
    - source ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/definitions.sh
    - source ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/version.sh
    - ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/deploy.sh
155
156
157
158
159
160
  dependencies:
    - ci:osx
  allow_failure: false
  only:
    - master
    - develop
161
162
    - /^release-.*$/
    - /^hotfix-.*$/
163
    - tags
164
    - web
165
166
167
  when: on_success
  artifacts:
    paths:
168
     - ${CI_PROJECT_DIR}/*.dmg
169
170
171
172
173
174
175
176
177
178
179
  tags:
    - sci
    - osx-10.13

############################
# windows 10 pipeline
# "call" is mandatory, see https://gitlab.com/gitlab-org/gitlab-runner/issues/1051
############################
ci:windows:
  stage: ci
  script:
180
181
182
183
    - call "%CI_PROJECT_DIR%\\BuildServer\\Windows\\definitions.bat"
    - call "%CI_PROJECT_DIR%\\BuildServer\\Windows\\version.bat"
    - call "%CI_PROJECT_DIR%\\BuildServer\\Windows\\build.bat"
    - call "%CI_PROJECT_DIR%\\BuildServer\\Windows\\tests.bat"
184
185
186
  allow_failure: false
  artifacts:
    paths:
187
    - "%CI_PROJECT_DIR%\\BuildServer\\Windows\\Build"
188
    expire_in: 1 hrs
189
190
191
192
193
194
195
  tags:
    - sci
    - windows-10

deploy:windows:
  stage: deploy
  script:
196
197
198
    - call "%CI_PROJECT_DIR%\\BuildServer\\Windows\\definitions.bat"
    - call "%CI_PROJECT_DIR%\\BuildServer\\Windows\\version.bat"
    - call "%CI_PROJECT_DIR%\\BuildServer\\Windows\\deploy.bat"
199
200
201
202
203
204
  dependencies:
    - ci:windows
  allow_failure: false
  only:
    - master
    - develop
205
206
    - /^release-.*$/
    - /^hotfix-.*$/
207
    - tags
208
    - web
209
210
211
  when: on_success
  artifacts:
    paths:
212
     - "%CI_PROJECT_DIR%\\*.exe"
213
214
215
216
  tags:
    - sci
    - windows-10

eric pellegrini's avatar
eric pellegrini committed
217
docker_logout:
eric pellegrini's avatar
eric pellegrini committed
218
  stage: docker_logout
219
220
  when: always
  script:
221
    - docker logout
222
223
224
225
226
  tags:
    - docker
    - sci
    - ubuntu