-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.gitlab-ci.yml
108 lines (97 loc) · 1.72 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
stages:
- test
- build
- deploy
run_unit_tests:
stage: test
image: python:3.6-slim
script:
- pip install -q tox
- tox -e py36
tags:
- docker
flake8:
stage: test
image: python:3.6-slim
script:
- pip install -q tox
- tox -e flake8
tags:
- docker
mypy:
stage: test
image: python:3.6-slim
script:
- pip install -q tox
- tox -e mypy
tags:
- docker
.build_rpm_template: &build_rpm_definition
stage: build
image: registry.umiacs.umd.edu/docker/build/umbuild:$DISTRO
script:
- make rpm
artifacts:
expire_in: 1hr
paths:
- dist/
only:
- tags
tags:
- docker
build_rpm_rhel7:
<<: *build_rpm_definition
variables:
DISTRO: rhel7
build_rpm_rhel8:
<<: *build_rpm_definition
variables:
DISTRO: rhel8
build_python_package:
stage: build
image: python:3.6-slim
script:
- python setup.py sdist bdist_wheel
artifacts:
expire_in: 1hr
paths:
- dist/
only:
- tags
tags:
- docker
.deploy_rpm_template: &deploy_rpm_definition
stage: deploy
image: registry.umiacs.umd.edu/docker/build/umbuild:$DISTRO
script:
- make copy_rpm
- make createrepo
when: manual
only:
- tags
tags:
- umrepos
- docker
deploy_rpm_rhel7:
<<: *deploy_rpm_definition
variables:
DISTRO: rhel7
dependencies:
- build_rpm_rhel7
deploy_rpm_rhel8:
<<: *deploy_rpm_definition
variables:
DISTRO: rhel8
dependencies:
- build_rpm_rhel8
upload_pypi:
stage: deploy
image: python:3.6-slim
script:
- pip install -q twine
- twine upload -u $PYPI_USERNAME -p $PYPI_PASSWORD dist/$CI_PROJECT_NAME-$CI_COMMIT_TAG.tar.gz
when: manual
only:
- tags
dependencies:
- build_python_package