-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
146 lines (126 loc) · 3.07 KB
/
.gitlab-ci.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
#Tell Gitlab to load these environental vars from the variables list
variables:
PYPI_USER: SECURE
PYPI_PASS: SECURE
stages:
- build
- installer
- test
- deploy
# Define a template stage with common settings
# that can be extended by specific stages.
# The except block will skip this stage if the commit
# message contains [skip build]
.build-skip-template: &build-skip-template
stage: build
except:
variables:
- $CI_COMMIT_MESSAGE =~ /\[skip[ _-]build?\]/i
.build-install-template: &build-install-template
script:
- tox -e installer
artifacts:
paths:
- dist/
expire_in: 1 week
# The win/mac/linux build stages inherit settings
# from build-install-template
build linux installer:
<<: *build-skip-template
<<: *build-install-template
tags:
- shared-linux
build mac installer:
<<: *build-skip-template
<<: *build-install-template
tags:
- shared-mac
build windows installer:
<<: *build-skip-template
<<: *build-install-template
tags:
- shared-win
build docs:
<<: *build-skip-template
script:
- tox -e docs
tags:
- shared-linux
artifacts:
paths:
- doc/
expire_in: 1 week
test Linux:
stage: test
script:
- tox
tags:
- shared-linux
coverage: '/^TOTAL.*\s+(\d+\%)$/'
test macOS:
stage: test
script:
- tox
tags:
- shared-mac
test Windows:
stage: test
script:
- tox
tags:
- shared-win
# Template for deploy stages that depend on 'build docs'
# if the build stage is skipped, skip these also
.deploy-docs-skip-template: &deploy-docs-skip-template
stage: deploy
when: manual
except:
variables:
- $CI_COMMIT_MESSAGE =~ /\[skip[ _-]build?\]/i
dependencies:
- build docs
deploy docs to staging:
<<: *deploy-docs-skip-template
script:
# Note: the group/username directory must already exist on the server before calling this command
- rsync -avz -e'ssh -v' --numeric-ids --delete doc/build/html/* staging_docs_rsync:thompson318/ArUcoPatternMaker 2>&1
tags:
- docs-staging
environment:
name: staging
url: http://weisslab-lin.cs.ucl.ac.uk/staging/thompson318/ArUcoPatternMaker
only:
- master
deploy docs to production:
<<: *deploy-docs-skip-template
script:
# Note: the group/username directory must already exist on the server before calling this command
- rsync -avz -e'ssh -v' --numeric-ids --delete doc/build/html/* production_docs_rsync:thompson318/ArUcoPatternMaker 2>&1
tags:
- docs-production
environment:
name: production
only:
- public
deploy pip to PyPI:
stage: deploy
when: manual
only:
- tags
environment:
name: PyPI
url: https://pypi.python.org/pypi/ArUcoPatternMaker
tags:
- pip-production
artifacts:
paths:
- dist/
script:
# Install packages required to build/publish
# remove any previous distribution files
- pip install wheel twine setuptools
- rm -rf dist
# bundle installer
- python setup.py bdist_wheel
# Upload to pypi
- twine upload --repository pypi dist/* --username $PYPI_USER --password $PYPI_PASS