This repository has been archived by the owner on Aug 5, 2024. It is now read-only.
forked from billpmurphy/hask
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
171 lines (153 loc) · 3.51 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
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
variables:
SUFFIX: 3
DISTRIBUTION_NAME: $CI_PROJECT_NAME$SUFFIX
stages:
- check
- baseline test
- test
- build
- publish
check code smells:
stage: check
script:
- merchise_lint3
tags:
- merchise-lint3
allow_failure: true
except:
- tags
check signature:
stage: check
script:
- git verify-commit $CI_COMMIT_REF_NAME
tags:
- git
- gpg
only:
- master
check signature of tag:
stage: check
script:
- git verify-tag $CI_COMMIT_REF_NAME
tags:
- git
- gpg
only:
- tags
run all tests in Python 3.6:
stage: test
script: tox -e3.6
tags:
- python3.6
except:
- tags
run doctests:
stage: test
allow_failure: true
script:
- pip install pipenv
- pipenv install --dev
- pipenv run sphinx-build -M doctest docs/source docs/build
tags:
- python3.6
except:
- tags
build documentation:
stage: build
script:
- pip install pipenv
- pipenv install --dev
- pipenv run sphinx-build -M html docs/source docs/build
- cd docs/build/html
- tar -cjf ../../../$CI_PROJECT_NAME-$CI_COMMIT_SHA.tar.bz2 ./
artifacts:
paths:
- $CI_PROJECT_NAME-$CI_COMMIT_SHA.tar.bz2
expire_in: 4 days
tags:
- virtualenv
only:
- tags
- master
publish in our rtd:
variables:
GIT_STRATEGY: none
stage: publish
script:
- scp $CI_PROJECT_NAME-$CI_COMMIT_SHA.tar.bz2 [email protected]:.
- ssh [email protected] mkdir -p $DISTRIBUTION_NAME/.$CI_COMMIT_SHA
- ssh [email protected] tar -xf $CI_PROJECT_NAME-$CI_COMMIT_SHA.tar.bz2 -C $DISTRIBUTION_NAME/.$CI_COMMIT_SHA
- ssh [email protected] "rm -r /var/www/html/$DISTRIBUTION_NAME/$CI_COMMIT_REF_NAME; ln -sr /var/www/html/$DISTRIBUTION_NAME/.$CI_COMMIT_SHA /var/www/html/$DISTRIBUTION_NAME/$CI_COMMIT_REF_NAME"
- ssh [email protected] rm $CI_PROJECT_NAME-$CI_COMMIT_SHA.tar.bz2
- ssh [email protected] "cd /var/www/html/$DISTRIBUTION_NAME; ls -al | grep -oE '\.([0-9]|[a-z])*$' | sort | uniq -c | grep '1 ' | grep -oE '\.([0-9]|[a-z])*$' | xargs rm -rf"
tags:
dependencies:
- build documentation
environment:
name: docs.lahavane.com
url: http://docs.lahavane.com/$DISTRIBUTION_NAME/$CI_COMMIT_REF_NAME
only:
- tags
- master
build source distribution:
stage: build
script:
- rm -f dist/*
- python setup.py sdist
tags:
- python
artifacts:
expire_in: 4 hours
paths:
- dist/
only:
- tags
build binary distribution:
stage: build
script:
- rm -f dist/*
- python setup.py bdist_wheel
tags:
- wheel
artifacts:
expire_in: 4 hours
paths:
- dist/
only:
- tags
publish_locally:
variables:
GIT_STRATEGY: none
stage: publish
script:
- ssh [email protected] "mkdir -p Repos/$DISTRIBUTION_NAME"
- scp dist/* [email protected]:Repos/$DISTRIBUTION_NAME/
tags:
- repo.lahavane.com
only:
- tags
dependencies:
- check signature of tag
- build source distribution
- build binary distribution
environment:
name: repo.lahavane.com
url: http://repo.lahavane.com/pypi/$DISTRIBUTION_NAME
publish in pypi:
variables:
GIT_STRATEGY: none
stage: publish
script:
- twine upload --skip-existing dist/*
tags:
- twine
only:
- tags
dependencies:
- check signature of tag
- build source distribution
- build binary distribution
environment:
name: pypi
url: https://pypi.org/project/$DISTRIBUTION_NAME/$CI_COMMIT_REF_NAME