-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
81 lines (73 loc) · 1.8 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
81 lines (73 loc) · 1.8 KB
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
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache"
cache:
paths:
- .cache/pip
- venv/
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:$NEXUS_PASSWORD@nexus.wopr.inf.mdc/repository/pypi-all/pypi
--index-url=https://$NEXUS_USERNAME:$NEXUS_PASSWORD@nexus.wopr.inf.mdc/repository/pypi-all/simple
lint:
stage: test
tags:
- wopr
script:
- pylint --rcfile=.pylintrc src
except:
refs:
- master
variables:
- $CI_COMMIT_MESSAGE =~ /^Setting version to.*/
test:
stage: test
tags:
- wopr
script:
- python -m pytest --cov-report term:skip-covered --cov src/ test/
coverage: '/TOTAL.*\s+(\d+%)$/'
publish-stable:
stage: publish
tags:
- wopr
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
script:
- python setup.py egg_info 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.*/