-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
85 lines (77 loc) · 1.9 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
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache"
cache:
paths:
- .cache/pip
stages:
- test
- publish
- release
default:
image: registry.mdcatapult.io/informatics/docker-images/ci/python:3.7
before_script:
- >
pip install -r requirements.txt
--index=https://$NEXUS_USERNAME:[email protected]/repository/pypi-all/pypi
--index-url=https://$NEXUS_USERNAME:[email protected]/repository/pypi-all/simple
lint:
stage: test
tags:
- wopr
script:
- pylint --rcfile=.pylintrc src
except:
variables:
- $CI_COMMIT_MESSAGE =~ /^Setting version to.*/
test:
stage: test
tags:
- wopr
script:
- coverage run --source=src -m pytest
- coverage report
coverage: /^TOTAL.+?(\d+\%)$/
except:
variables:
- $CI_COMMIT_MESSAGE =~ /^Setting version to.*/
publish-stable:
stage: publish
tags:
- wopr
before_script:
- pip install twine
script:
- python setup.py sdist bdist_wheel
- twine upload -u $NEXUS_USERNAME -p $NEXUS_PASSWORD --repository-url https://nexus.wopr.inf.mdc/repository/pypi-stable/ dist/*
- twine upload -u $PYPI_USERNAME -p $PYPI_PASSWORD --repository-url https://upload.pypi.org/legacy/ dist/*
only:
refs:
- tags
variables:
- $CI_COMMIT_MESSAGE =~ /^Setting version to.*/
publish-unstable:
stage: publish
tags:
- wopr
before_script:
- pip install twine
script:
- python setup.py sdist bdist_wheel
- twine upload -u $NEXUS_USERNAME -p $NEXUS_PASSWORD --repository-url https://nexus.wopr.inf.mdc/repository/pypi-unstable/ dist/*
except:
refs:
- master
variables:
- $CI_COMMIT_MESSAGE =~ /^Setting version to.*/
release:
stage: release
tags:
- wopr
before_script: [""]
script:
- /scripts/release.sh src
only:
- master
except:
variables:
- $CI_COMMIT_MESSAGE =~ /^Setting version to.*/