-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
120 lines (110 loc) · 2.4 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
stages:
- test
- build
- deploy
flake8:
stage: test
image: python:3.6-slim
script:
- pip install -q tox
- tox -e flake8
tags:
- docker
run_unit_tests_py27:
stage: test
image: python:2.7-slim
script:
- pip install -q tox
- tox -e py27
tags:
- docker
run_unit_tests_py36:
stage: test
image: python:3.6-slim
script:
- pip install -q tox
- tox -e py36
tags:
- docker
build_python_package:
stage: build
image: python:3.6-slim
script:
- pip install -q -U setuptools wheel
- python setup.py sdist bdist_wheel
artifacts:
expire_in: 1hr
paths:
- dist/
only:
- tags
tags:
- docker
build_rpm_rhel7:
stage: build
image: registry.umiacs.umd.edu/docker/build/umbuild:rhel7
script:
- make rpm PYTHON=python
- mkdir -p dist/rhel7
- cp /srv/build/rhel7/RPMS/noarch/$CI_PROJECT_NAME-$CI_COMMIT_TAG-1.noarch.rpm dist/rhel7/$CI_PROJECT_NAME-$CI_COMMIT_TAG-1.noarch.rpm
artifacts:
expire_in: 1hr
paths:
- dist/
only:
- tags
tags:
- docker
build_rpm_rhel8:
stage: build
image: registry.umiacs.umd.edu/docker/build/umbuild:rhel8
script:
- make rpm PYTHON=python3
- mkdir -p dist/rhel8
- cp /srv/build/rhel8/RPMS/noarch/$CI_PROJECT_NAME-$CI_COMMIT_TAG-1.noarch.rpm dist/rhel8/$CI_PROJECT_NAME-$CI_COMMIT_TAG-1.noarch.rpm
artifacts:
expire_in: 1hr
paths:
- dist/
only:
- tags
tags:
- docker
upload_umpypi_pypi:
stage: deploy
image: python:3.6-slim
script:
- pip install -q twine
- twine upload --repository-url $UMPYPI_REPOSITORY_URL -u $UMPYPI_USERNAME -p $UMPYPI_PASSWORD dist/*
- twine upload -u $PYPI_USERNAME -p $PYPI_PASSWORD dist/*
when: manual
only:
- tags
tags:
- docker
dependencies:
- build_python_package
.deploy_rpm_template: &deploy_rpm_definition
stage: deploy
image: registry.umiacs.umd.edu/docker/build/umbuild:$DISTRO
script:
- sudo cp "dist/$DISTRO/$CI_PROJECT_NAME-$CI_COMMIT_TAG-1.noarch.rpm" /srv/UMyumrepos/$DISTRO/stable/Packages/noarch
- sudo createrepo --workers=4 /srv/UMyumrepos/$DISTRO/stable
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