-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.gitlab-ci.yml
111 lines (101 loc) · 2.53 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
stages:
- create_env
- testing
- deploy
- pages
variables:
PIP_CACHE_DIR: "${CI_PROJECT_DIR}/.cache/pip"
.python_base: &python_base
tags:
- docker
image: python:3.8
.cached_python_base: &cached_python_base
<<: *python_base
before_script:
- find ${CI_PROJECT_DIR}/.venv/ -xtype l -delete
- python -m venv ${CI_PROJECT_DIR}/.venv/
- . ${CI_PROJECT_DIR}/.venv/bin/activate
dependencies:
- create_env
only:
- branches
create_env:
stage: create_env
<<: *python_base
script:
- pip install poetry
- poetry config virtualenvs.in-project true
- poetry install --remove-untracked
artifacts:
expire_in: 1 day
paths:
- ${CI_PROJECT_DIR}/.venv
cache:
key: "${CI_JOB_NAME}"
paths:
- .cache/pip
- .venv
test:
stage: testing
<<: *cached_python_base
script:
- doit test -p "-n 2"
lint:
stage: testing
<<: *cached_python_base
script:
- doit -v 0 --continue format_check lint
docs:
stage: deploy
<<: *cached_python_base
script:
- doit docs
- cp -r docs/_build/html ./html_docs
artifacts:
paths:
- html_docs
expire_in: 2 month
cache:
key: "${CI_JOB_NAME}_${CI_COMMIT_BRANCH}"
paths:
- docs/auto_examples
- docs/_build
package:
stage: deploy
<<: *cached_python_base
only:
- master
script:
- deactivate && pip install poetry
- poetry config repositories.gaitmap https://mad-srv.informatik.uni-erlangen.de/api/v4/projects/943/packages/pypi
- wget https://pki.pca.dfn.de/dfn-ca-global-g2/pub/cacert/chain.txt -O /tmp/fau.crt
- poetry config certificates.gaitmap.cert /tmp/fau.crt
- poetry run doit create_prerelease
- poetry publish --build --repository gaitmap -u gitlab-ci-token -p ${CI_JOB_TOKEN}
- cd gaitmap_mad && poetry publish --build --repository gaitmap -u gitlab-ci-token -p ${CI_JOB_TOKEN}
package_release:
stage: deploy
<<: *cached_python_base
only:
- tags
script:
- deactivate && pip install poetry
- poetry config repositories.gaitmap https://mad-srv.informatik.uni-erlangen.de/api/v4/projects/943/packages/pypi
- wget https://pki.pca.dfn.de/dfn-ca-global-g2/pub/cacert/chain.txt -O /tmp/fau.crt
- poetry config certificates.gaitmap.cert /tmp/fau.crt
- poetry publish --build --repository gaitmap -u gitlab-ci-token -p ${CI_JOB_TOKEN}
pages:
stage: pages
dependencies:
- docs
tags:
- docker
script:
- mkdir .public
- cp -r html_docs/* .public
- mv .public public
artifacts:
paths:
- public
only:
- master