forked from cms-gem-daq-project/cmsgemos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
281 lines (258 loc) · 12.8 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
sudo: required
language: cpp
stages:
- setup
- compile
- name: buildrpm
- test
- coverage
- name: docs
## allowed tags: replace 'dev' from allowed tags (will be added for non-tagged releases) with 'beta
## allowed tags: remove 'git12345678' from allowed tags
if: ( ( branch = master ) OR ( tag =~ ^v?(.)?([0-9]+).([0-9]+).([0-9]+)(-(pre|rc|alpha|beta)([0-9]+$))? ) )
- name: prerelease
if: tag =~ ^v?(.)?([0-9]+).([0-9]+).([0-9]+)(-(pre|rc)([0-9]+))$
- name: devrelease
if: tag =~ ^v?(.)?([0-9]+).([0-9]+).([0-9]+)(-(alpha|beta)([0-9]+))$
- name: release
if: tag =~ ^v?(.)?([0-9]+).([0-9]+).([0-9]+)$
- name: deployment
if: tag =~ ^v?(.)?([0-9]+).([0-9]+).([0-9]+)(-(pre|rc|alpha|beta)([0-9]+$))?$
.docs: &docs_cond
if: ( ( branch = master ) OR ( tag =~ ^v?(.)?([0-9]+).([0-9]+).([0-9]+)(-(pre|rc|alpha|beta)([0-9]+$))? ) )
# .draftrelease: &draftrelease_cond
# condition: $TRAVIS_TAG =~ ^v?(.)?([0-9]+).([0-9]+).([0-9]+)(-(pre|rc|alpha|beta)([0-9]+))?$
.prerelease: &prerelease_cond
condition: $TRAVIS_TAG =~ ^v?(.)?([0-9]+).([0-9]+).([0-9]+)(-(pre|rc)([0-9]+))$
.devrelease: &devrelease_cond
condition: $TRAVIS_TAG =~ ^v?(.)?([0-9]+).([0-9]+).([0-9]+)(-(alpha|beta)([0-9]+))$
.releasecond: &release_cond
condition: $TRAVIS_TAG =~ ^v?(.)?([0-9]+).([0-9]+).([0-9]+)$
# .deploycond: &deploy_cond
# condition: $TRAVIS_TAG =~ ^v?(.)?([0-9]+).([0-9]+).([0-9]+)(-(pre|rc|alpha|beta)([0-9]+$))?$
.deploycond: &deploy_cond
if: tag =~ ^v?(.)?([0-9]+).([0-9]+).([0-9]+)(-(pre|rc|alpha|beta)([0-9]+$))?$
env:
global:
- REPO_NAME=${TRAVIS_REPO_SLUG#?*/}
## Encrypted variables:
## * CHANGELOG_GITHUB_TOKEN: for running github_changelog_generator without API rate limits
- secure: "cWz6NmAZFtp30xIO8ieP10x7M8RLjjh1xNlu5qEgqrb9YhQLFxdIIObBw+3DcbaFBfwp0pzm4omZe8y2Lmda30ESBOrL2pX60r550Rx/JgqydFGfryRuKPLhtGyzQ3duVKIjRlKrKLUAoBzDhgM4v8rtGLaoiOrlK5JVgicrye3AgH7voOYys5sOJ/+TpAwa44690F+LCDLCOredryXMYmOo1ZNFRyq9HrEVSBeQ+1unBC6voY7NPtvGZYk8z0PeDOOX32nkZP5AEEOnQk4rl6CCALpnC5Y7ypBDi3AkFqCocomocmZUr4/m3QpERFxsZiYQD9uV93YHyqfCeDA/jA4Pgh6PiPdOvr7409z3H/CZWENInqtMMnvOPFxzO8CUxrtUamyuAgihq6VP6nKO++fX6ZfvwqxtJs8pqE0MorfIZo8vAFQ+SeiaIAEq1njL3b4/8hrQifb912KNB3ePnQSzDnxefYeu0dotK/ACUrkLxGl5Qa9USrpy6r7cVTVH8DJfqk10xIVX2tLlc6ydekLCtNnMFAAg0+PvEb9r/g+Hc1civfUg4mDGVji6N4kqkHuBUZfw+c4uSztSdNDNqQnQDYdrbJR1K2TkQhSP5ShWsfmz42lFiYbVbvmwojV1fH2RXARBy4f6IfMCbrGQec3O0VIPGl8MmW9ThfEfuqY="
- secure: "TZ1l7ZB/nCsCm3HjzoVvQVm6nvN0NvvDVfCUvAkaZVdLtDARzkFAow8kXpcfm/dNBC/XtJaqHiRx3uJPiMdLYw48UpKfkAceWvumoiwyZf4YaymhA0W0lwX/Lqg1kNURv9nC0Zh+kKGMQrgSAYvuKpWrkspxOGbu7F7r1ZuDPS9MKPEgInLwgSZqyrzdxdw1IWQenSPoIbNs72S2avdOTsR7uuATKNyJCAreqyRBbJnqvl8omMd2ZNaz5w2meK07RyaQouIIFqhihbK+cR/CSKE98aEXTdYVNb/wM+LjelnXSUYSRT8FTcXFQ4y6xoSXybhJrrIZ/m2d1Ac9dP3wbYt1sljlbyefp93cOJtTXgCfwiBKCS0whC1MrSq9irgWJwRVctosrUIHtwDMYH6AKzdOhHGrCbL5nwG8CmeulN0GtRChjKk1REWxvwpMMxKSGlgCiSElkhNw7v2xCaWQDCd+N2HU7asuJtAOoTvpRqxYzzXywWgmDiEw7V2RHqNTGo/hrctIqwMdIS7sZWZZ0wC7GUC6dcTGqFlIqf7wH4pVhpBZzDwxItmJ3AXJuv3xmZBXNXhXJorBpOyBio3LcoWVaLBfXfX1rgYMR2IJOPx8en9GhEhpDkTyhymkyy+NOEIJBnfJh5zvzEX7Nz3WbEj3Bfp0mOAj85Jx4h7uko0="
matrix:
# what are the realistic things we want to test against?
# C/C++ compiler versions:
# gcc: 447, 485, 492, 531, 631, 64X, 71X, 721?
# clang: 32, 34, 35, 36, 37, 38, 39, 4, 5, 6, 7?
# libc++ vs libstdc++
# c++11, c++14, c++17, etc
# xDAQ release versions:
# cmsos13 on slc6
# cmsos14 on cc7
# cmsos15 on (cc7, cc8?)
# Python versions
# 26, 27, 32, 33, 34, 35, 36, pypy27, pypy32, pypy35?
# needed vars:
# PYTHON_VERSON
# CLANG_VERSON
# GCC_VERSON
# COMPILER = CLANG/GCC
# - OS_TYPE=slc OS_VERSION=6 DOCKER_IMAGE=gitlab-registry.cern.ch/cms-gem-daq-project/gemdaq_ci_worker/extrapy/devtoolsroot:slc6
# - OS_TYPE=cc OS_VERSION=7 DOCKER_IMAGE=gitlab-registry.cern.ch/cms-gem-daq-project/gemdaq_ci_worker/extrapy/devtoolsroot:cc7
# - OS_TYPE=centos OS_VERSION=8 DOCKER_IMAGE=gitlab-registry.cern.ch/cms-gem-daq-project/gemdaq_ci_worker/extrapy/devtoolsroot:cc8
services:
- docker
before_install:
- git tag -l
- git rev-list --tags --max-count=1 2>/dev/null
- git describe --tags $(git rev-list --tags --max-count=1 2>/dev/null) 2>/dev/null
- ./.ci/docker.sh setup ${DOCKER_IMAGE}
- sleep 1
- ./.ci/docker.sh start ${DOCKER_IMAGE}
- DOCKER_CONTAINER_ID=$(docker ps | grep ${DOCKER_IMAGE} | awk '{print $1}')
- echo DOCKER_CONTAINER_ID=$DOCKER_CONTAINER_ID
script:
- echo 'Running test stage on docker container $DOCKER_CONTAINER_ID'
# - docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -eic ". /home/daqbuild/${REPO_NAME}/.ci/travis.sh ${OS_VERSION} ${PY_VER} ${ROOT_VER}"
## Defaults, applied to the 'test' stage
after_success:
- ./.ci/docker.sh stop ${DOCKER_IMAGE}
after_failure: skip
after_script: skip
# How to link the environments/outputs from above with the jobs below?
.slc6_template: &slc6_template
env:
- OS_TYPE=slc
- PY_VER=python
- OS_VERSION=6
- DOCKER_IMAGE=gitlab-registry.cern.ch/cms-gem-daq-project/gemdaq_ci_worker/extrapy/devtoolsroot:slc6
.cc7_template: &cc7_template
env:
- OS_TYPE=cc
- PY_VER=python
- OS_VERSION=7
- DOCKER_IMAGE=gitlab-registry.cern.ch/cms-gem-daq-project/gemdaq_ci_worker/extrapy/devtoolsroot:cc7
.rpmbuild: &rpmbuild_template
before_install:
- ./.ci/docker.sh setup ${DOCKER_IMAGE}
- sleep 1
- ./.ci/docker.sh start ${DOCKER_IMAGE}
- DOCKER_CONTAINER_ID=$(docker ps | grep ${DOCKER_IMAGE} | awk '{print $1}')
- echo DOCKER_CONTAINER_ID=$DOCKER_CONTAINER_ID
- sudo chown :daqbuild -R .
- gem install github_changelog_generator
script:
- echo 'Running build stage on docker container $DOCKER_CONTAINER_ID'
- git status -sb
- docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -eic "/home/daqbuild/${REPO_NAME}/.ci/travis.sh 'make -j8'" || travis_terminate 1
- docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -eic "/home/daqbuild/${REPO_NAME}/.ci/travis.sh 'make rpm'" || travis_terminate 1
- docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -eic "/home/daqbuild/${REPO_NAME}/.ci/travis.sh 'gemxaas/updateZones.sh'" || travis_terminate 1
- docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -eic "rpm -q --filesbypkg -p /home/daqbuild/${REPO_NAME}/gem*/rpm/*.rpm"
after_success:
- echo "Testing the installation of the package"
- virtualenv building -p python --system-site-packages
- . building/bin/activate
- pip install gempython/rpm/*.zip
- echo "Install the dependencies"
- echo "Run the predefined test"
- ./.ci/docker.sh stop ${DOCKER_IMAGE}
.release: &release_template
skip_cleanup: true
# publish to Github releases
provider: releases
api_key:
secure: "eVEjtiOHnYtH+I2+9bOI8SjffkV1EZ/dqJGvUEjVsX9QfC9yWd7Hb1sOJsMGBa94c2ua7qn97uyfeNnan/evz/LjH7sm/sQ6uwk4M6GavRjxp3Glz2NfR0cUM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XPPNh+nD895icHdRgshAfgiCdSPnVTiBFdE4YKiLYGtIIaMGllCom8A4CIatL2u18Ucc5ShmogqoO9uwkHwW2dITBujM7/2QWHCiNMiUgWN76VA8CgsrEu94DX2SqExPS5LAYqeVnsU9aj5UJh58RIs/cRUS/2vROasOw="
file_glob: true
file:
- LICENSE
- README.md
- CHANGELOG.md
# - "${RPMDIR}/*.tar.gz"
- "${RPMDIR}/*.zip"
- "${RPMDIR}/*.tgz"
- "${RPMDIR}/*.tbz2"
# RPMs are now all packaged in a tarball, to not clutter the release
# - "./rpm/*.rpm"
## pre-releases and draft releases for tags with pre/alpha/beta in the name
# draft: true # for tags with alpha/beta in the name, or
# prerelease: true # for tags with pre/rc in the name
## only deploy full release when the tag exactly matches vX.Y.Z (with or without the v)
prerelease: true
draft: false
name: $TRAVIS_TAG
body: "Please fill me, preferably with release notes for $TRAVIS_TAG"
on:
tags: true
# before_deploy:
# #Set up git user name and tag this commit
# - git config --local user.name "YOUR GIT USER NAME"
# - git config --local user.email "YOUR GIT USER EMAIL"
# # ?create the changelog
# # ?update release notes
# # ?run our gemostag script instead?
# # Sign the tags
# # - git tag "$(date +'%Y%m%d%H%M%S')-$(git log --format=%h -1)"
after_deploy: skip
# - push docs to SaaS docs website, readthedocs style, with versioning
# - push API to SaaS docs website, Doxygen style, with versioning
# - push RPMs to repo on openstack SaaS, updates and devel-testing depending on tag
.deploy: &deploy_template
before_deploy:
- export RPMOS=${OS_TYPE}${OS_VERSION}
- export RPMDIR=/tmp/${REPO_NAME}/rpm
- echo "Preparing ChangeLog"
- if ! test -z ${CHANGELOG_GITHUB_TOKEN+x}; then github_changelog_generator; else echo "Not updating changelog"; fi
- mkdir -p ${RPMDIR}/${RPMOS}/{RPMS,SRPMS,DEBUGRPMS,DEVRPMS}
- sudo find ${RPMDIR} -type d -print0 -exec chmod a+rx {} \+
- sudo chown :daqbuild -R .
- sudo chown :daqbuild -R /tmp/${REPO_NAME}
- sudo chmod g+srwX -R ${RPMDIR}
- sudo setfacl -Rdm u::rwX,g::rwX,o::rX /tmp/${REPO_NAME}
- sudo setfacl -Rm u::rwX,g::rwX,o::rX /tmp/${REPO_NAME}
- sudo ls -laZ ${RPMDIR}
- sudo ls -laZ ${RPMDIR}/../
- sudo ls -laZ ${RPMDIR}/../../
- ls -laZ CHANGELOG.md
- sudo find ./gem*/rpm -type f \( -iname '*.rpm' -o -iname '*.tar.gz' -o -iname '*.tgz' -o -iname '*.tbz2' -o -iname '*.zip' \) -print0 -exec chmod a+r {} \+
- find ./gem*/rpm -iname '*.src.rpm' -print0 -exec mv -t ${RPMDIR}/${RPMOS}/SRPMS {} \+
- find ./gem*/rpm -iname '*-devel-*.rpm' -print0 -exec mv -t ${RPMDIR}/${RPMOS}/DEVRPMS {} \+
- find ./gem*/rpm -iname '*-debuginfo-*.rpm' -print0 -exec mv -t ${RPMDIR}/${RPMOS}/DEBUGRPMS {} \+
- find ./gem*/rpm -iname '*.rpm' -print0 -exec mv -t ${RPMDIR}/${RPMOS}/RPMS {} \+
- find ./gem*/rpm \( -iname '*.tar.gz' -o -iname '*.tgz' -o -iname '*.tbz2' \) -print0 -exec mv -t ${RPMDIR}/ {} \+
- cd ${RPMDIR}
- tree
- find ./ -iname '*.rpm' -print0 -exec tar cjf cmsgemos_${TRAVIS_TAG}_${RPMOS}.tbz2 {} \+
- find ./ -iname '*.rpm' -print0 -exec tar czf cmsgemos_${TRAVIS_TAG}_${RPMOS}.tgz {} \+
deploy:
- <<: *release_template
prerelease: false
draft: false
on:
tags: true
<<: *release_cond
after_deploy:
- echo "Successfully deployed prerelease"
- <<: *release_template
on:
tags: true
<<: *prerelease_cond
after_deploy:
- echo "Successfully deployed prerelease"
# - <<: *release_template
# prerelease: false
# draft: true
# on:
# tags: true
# <<: *draftrelease_cond
# after_deploy:
# - echo "Successfully deployed draft release"
- <<: *release_template
prerelease: true
on:
tags: true
<<: *devrelease_cond
after_deploy:
- echo "Successfully deployed devrelease"
jobs:
include:
# - stage: buildrpm
# # if: NOT tag
# <<: *slc6_template
# <<: *rpmbuild_template
# - stage: buildrpm
# # if: NOT tag
# <<: *cc7_template
# <<: *rpmbuild_template
- stage: test
before_script: skip
before_install: skip
script: skip
after_script: skip
after_install: skip
after_success: skip
after_failure: skip
# - stage: docs
# before_script: skip
# before_install: skip
# script:
# - ls -laZ
# after_success: skip
# - stage: coverage
# # if: NOT tag
# before_script: skip
# before_install: skip
# script: skip
# after_success:
# - sudo pip install -U codecov
# # - coverage run -a scripta.py
# - codecov
# - bash <(curl -s https://codecov.io/bash) && echo "Uploaded code coverage"
- stage: deployment
<<: *slc6_template
<<: *rpmbuild_template
<<: *deploy_template
- stage: deployment
<<: *cc7_template
<<: *rpmbuild_template
<<: *deploy_template