This repository has been archived by the owner on Jan 31, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
/
.travis.yml
233 lines (210 loc) · 10.4 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
sudo: required
language: generic
stages:
- setup
- compile
- name: buildrpm
- test
- coverage
- name: docs
if: ( ( branch = master ) OR ( tag =~ ^v?(.)?([0-9]+).([0-9]+).([0-9]+)(-(pre|rc|alpha|dev)([0-9]+$))?|(-git[0-9a-z]{6,8})?$ ) )
- 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]+)(-(pre|rc)([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|dev)([0-9]+$))?|(-git[0-9a-z]{6,8})?$
.docs: &docs_cond
if: ( ( branch = master ) OR ( tag =~ ^v?(.)?([0-9]+).([0-9]+).([0-9]+)(-(pre|rc|alpha|dev)([0-9]+$))?|(-git[0-9a-z]{6,8})?$ ) )
.draftrelease: &draftrelease_cond
condition: $TRAVIS_TAG =~ ^v?(.)?([0-9]+).([0-9]+).([0-9]+)(-(pre|rc|dev|alpha)([0-9]+))?(-git[0-9a-z]{6,8})$
.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]+)(-(dev|alpha)([0-9]+))$
.release: &release_cond
condition: $TRAVIS_TAG =~ ^v?(.)?([0-9]+).([0-9]+).([0-9]+)$
# .deploy: &deploy_cond
# condition: $TRAVIS_TAG =~ ^v?(.)?([0-9]+).([0-9]+).([0-9]+)(-(pre|rc|alpha|dev)([0-9]+$))?|(-git[0-9a-z]{6,8})?$
.deploy: &deploy_cond
if: tag =~ ^v?(.)?([0-9]+).([0-9]+).([0-9]+)(-(pre|rc|alpha|dev)([0-9]+$))?|(-git[0-9a-z]{6,8})?$
env:
global:
- REPO_NAME=${TRAVIS_REPO_SLUG#?*/}
## Encrypted variables:
## * CHANGELOG_GITHUB_TOKEN: for running github_changelog_generator without API rate limits
- secure: "XxlVvfq1thacPo1ydmk6OgyQrpuMuWdN7kXopeSYM6X9zsoF3iiqxHEQlK4+NhU3kEoaKpaKmiN/a8x/nOn4ahgKtg0GDuGm5udAHEH1P/r8j+Qe/Dfbuwow27ZqkX2uWqbj/GpheT8tIrQR2rme73egkZdZyJt2wrmHgBOLNW1tfJGh8lTHOlztRhGejEwBPHs4AJZQNSweTKdZP8nUePPQk2Y8NECp1wDL9r/lC/wrLnE0hS6oN5GAwek0rZ1EZlLS6+RepnJrQNRuFewFMw3m9COdJTKi/4ocgeLe5vyWHbVs2coaIouIrXuZmIjGpFDw9SwkN2BRZwCrNi2whNjEAFSLWnM6SN4UaPwMyG7Fe2bs3gasp9oJeMA+LM1UOUDzHwZgM/e+Sn2ewf0f3TIrtKxbTLTl88s5uyRu9vJd/vuYTmoKYIx2YnejjKp22vxRuShF0JFTnPsPo0G/x5uDmpZCT6lpD/L68TvzpU0OVLOZlw5Jw6r023bG475SJ3bFttn2MNoEavrVilBG1aHWV0x2GsmLSHX40dNTOxmlah7fez+Ppgsy/jCVC8WH9vXLC6BWNvbjv2OL187Y+p4RFe+2v6WgZKst9RISb702Hi9tlLdokjKwvaexQ49f2DakkRfFqFwPxlMeLOx0mPCd+vCATEiTc1isjVjEiaM="
matrix: ## this is *only* for the built-in 'test' stage, doesn't currently transfer to other stages, beta feature
# - OS_TYPE=centos PY_VER=python OS_VERSION=6 DOCKER_IMAGE=gitlab-registry.cern.ch/cms-gem-daq-project/gemdaq_ci_worker/extrapy/devtoolsroot:slc6 ROOT_VER=v5.34.36-gcc4.4
# - OS_TYPE=centos PY_VER=python2.6 OS_VERSION=6 DOCKER_IMAGE=gitlab-registry.cern.ch/cms-gem-daq-project/gemdaq_ci_worker/extrapy/devtoolsroot:slc6
# - OS_TYPE=centos PY_VER=pypy OS_VERSION=6 DOCKER_IMAGE=gitlab-registry.cern.ch/cms-gem-daq-project/gemdaq_ci_worker/extrapy/devtoolsroot:slc6 ROOT_VER=v5.34.36-gcc4.4
### CC7 jobs
# - OS_TYPE=centos PY_VER=python OS_VERSION=7 DOCKER_IMAGE=gitlab-registry.cern.ch/cms-gem-daq-project/gemdaq_ci_worker/extrapy/devtoolsroot:cc7 ROOT_VER=v5.34.36-gcc4.8
# - OS_TYPE=centos PY_VER=python OS_VERSION=7 DOCKER_IMAGE=gitlab-registry.cern.ch/cms-gem-daq-project/gemdaq_ci_worker/extrapy/devtoolsroot:cc7 ROOT_VER=v6.10.08-gcc4.8
- OS_TYPE=centos PY_VER=python OS_VERSION=7 DOCKER_IMAGE=gitlab-registry.cern.ch/cms-gem-daq-project/gemdaq_ci_worker/extrapy/devtoolsroot:cc7 ROOT_VER=v6.12.06-gcc4.8
# - OS_TYPE=centos PY_VER=pypy3 OS_VERSION=7 DOCKER_IMAGE=gitlab-registry.cern.ch/cms-gem-daq-project/gemdaq_ci_worker/extrapy/devtoolsroot:cc7
services:
- docker
before_install:
- ./.ci/docker.sh setup ${DOCKER_IMAGE}
- sleep 2
- ./.ci/docker.sh start ${DOCKER_IMAGE}
- DOCKER_CONTAINER_ID=$(docker ps | grep ${DOCKER_IMAGE} | awk '{print $1}')
- echo DOCKER_CONTAINER_ID=$DOCKER_CONTAINER_ID
# Stages run in their own VMs, nothing gets transferred from stage to stage
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/test_on_docker.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=centos
- 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=centos
- 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 2
- ./.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'
- docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -eic "sudo pip install -Ur /home/daqbuild/${REPO_NAME}/requirements-dev.txt" || travis_terminate 1
- docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -eic "cd /home/daqbuild/${REPO_NAME}; make" || travis_terminate 1
- docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -eic "cd /home/daqbuild/${REPO_NAME}; make rpm" || travis_terminate 1
- docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -eic "cd /home/daqbuild/${REPO_NAME}; rpm -q --filesbypkg -p rpm/*.rpm"
- ls -laZ rpm
- find ./rpm -iname '*.rpm' -o -iname '*.tar.gz' -o -iname '*.tbz2'
after_success:
- echo "Testing the installation of the package"
- virtualenv building -p python --system-site-packages
- . building/bin/activate
- pip install --no-deps rpm/gempython_gemplotting-[0-9].[0-9].[0-9].tar.gz
- echo "Generate documentation"
- docker exec -ti $DOCKER_CONTAINER_ID /bin/bash -ec ". /opt/root/v6.12.06-gcc4.8/root/bin/thisroot.sh; cd /home/daqbuild; virtualenv building -p python --no-site-packages; . building/bin/activate; cd ${REPO_NAME}; pip install pip==9.0.3; pip install -U -r requirements-dev.txt; pip install rpm/gempython_gemplotting-[0-9].[0-9].[0-9].tar.gz; make html"
- 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:
## API key to deploy to github release
secure: "ZIEEaQD6tExx216LZcQTIoe0UsHtorJhedFZ6RPpW9igII0cAB9t3JJcn8nNRIvSp3bMf+jdljzAU3xw3RgnJ6tG5wFFcxpfq7nwY8KEDnjNc50FQTTcqMWvgUUmcjMc84KpyhIRe66+XqY3pZilvMEZXlNVkRcKT2+M6InDSxfTj8kZo1DuVEDg0ET/7iCpsi8VYgh4trIa96WzAA4XaBmUiRLTlKV/cmAqgpaUWNLPntkcYko3R1BxWEztQClAnW6mVA8MUT9zfVS54UnT0taGQAqemOcFLuKfoReX6UHoJey55Q8j5vdtnjYZ0sDCPcDD4vm0O0336qp9xoiif5AcdAhaGrw1rTKG01/6HTH+xaaCjarkt9XMGeLL5lQh3PEJANB2Npwhw5OklxuOkWtakL1XcTbRJ7DpnFhuKtcGLIqE8PydByFzSW6yDrB8/Vof8SG4UYy8N50/A9BU+iD2EkaA5SrT0ff076+EYzo0d/qTmlqFloGSmdXQTfnbSIjFO9JIPaHveZUsGbqVy9RUXO7HMi4u39Q1H1x8Ti7vwcwdmIah/UftMH5GyB27x7cMp9Buw5gxmF+1YslZgVOilvy8qZDglU6cETR7gw0+mQf/rm+O0v4l0RnI1tae8HZvKWbqZ5dzmFUMDIwhJvywR4VsEAN6WVDxkb6QXlQ="
file_glob: true
file:
- LICENSE
- README.md
- CHANGELOG.md
- "./rpm/*.tar.gz"
- "./rpm/*.tgz"
- "./rpm/*.tbz2"
- "./rpm/*.rpm"
## pre-releases and draft releases for tags with pre/alpha/dev/gitHASH in the name
# draft: true # for tags with dev/alpha in the name, or
# prerelease: true # for tags with pre 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 cmsgemostag 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:
- echo "Preparing ChangeLog"
- if ! test -z ${CHANGELOG_GITHUB_TOKEN+x}; then github_changelog_generator; else echo "Not updating changelog"; fi
- sudo chown :daqbuild -R .
- ls -laZ CHANGELOG.md
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
# <<: *slc6_template
# <<: *rpmbuild_template
- stage: buildrpm
<<: *cc7_template
<<: *rpmbuild_template
- stage: docs
before_script: skip
before_install: skip
script:
- ls -laZ
after_success: skip
- stage: coverage
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