forked from ClusterLabs/pcs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
207 lines (194 loc) · 4.49 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
image: fedora${CI_PCS_FC_IMG_TAG}
variables:
PYTHON_DEPENDENCIES: "
python3-cryptography
python3-devel
python3-lxml
python3-pycurl
python3-pyparsing
python3-setuptools
python3-setuptools_scm
python3-wheel
"
RUBY_GEMS: "
rubygem-backports
rubygem-ethon
rubygem-ffi
rubygem-io-console
rubygem-json
rubygem-open4
rubygem-rack
rubygem-rack-protection
rubygem-rack-test
rubygem-rexml
rubygem-sinatra
rubygem-test-unit
rubygem-thin
rubygem-tilt
rubygem-webrick
"
COMMON_DEPENDENCIES: "
autoconf
automake
coreutils
curl
findutils
git
make
sed
systemd
tar
time
wget
python3-pip
pkgconf-pkg-config
ruby
ruby-devel
rubygem-bundler
"
COMMON_BUILD_DEPENDENCIES: "
gcc
gcc-c++
psmisc
redhat-rpm-config
${COMMON_DEPENDENCIES}
${PYTHON_DEPENDENCIES}
"
APP_VERSION: "0.0.1.ci"
DIST_VERSION: "${APP_VERSION}.${CI_PROJECT_NAMESPACE}-${CI_COMMIT_SHORT_SHA}"
RPM_VERSION: "${APP_VERSION}-1.${CI_PROJECT_NAMESPACE}.$CI_COMMIT_SHORT_SHA"
default:
before_script:
- "echo ${DIST_VERSION} > .tarball-version"
- cat .tarball-version
stages:
- stage1
- stage2
rpm_build:
stage: stage1
script:
- "dnf install -y
${COMMON_BUILD_DEPENDENCIES}
dnf-plugins-core
rpm-build
rpmdevtools
"
- ./autogen.sh
- ./configure --enable-local-build
- make rpm/pcs.spec
- dnf builddep -y rpm/pcs.spec
- make rpm
- mkdir -p rpms && cp -v $(find rpm -type f -name '*.rpm' -not -name '*.src.rpm') rpms
artifacts:
expire_in: 1 week
paths:
- rpms
distcheck:
stage: stage1
script:
- "dnf install -y
${COMMON_BUILD_DEPENDENCIES}
${RUBY_GEMS}
bzip2
xz
"
- "pip3 install
dacite
tornado
pyagentx
"
- ./autogen.sh
- ./configure --enable-local-build
- make distcheck DISTCHECK_CONFIGURE_FLAGS='--enable-local-build'
- mkdir -p dist && cp -v pcs*.tar.* dist/
artifacts:
expire_in: 1 week
paths:
- dist
black:
stage: stage1
script:
- dnf install -y ${COMMON_DEPENDENCIES}
- python3 -m pip install --upgrade -r dev_requirements.txt
- ./autogen.sh
- ./configure --enable-local-build --enable-dev-tests --enable-tests-only
- make black_check
pylint:
stage: stage1
script:
- dnf install -y ${COMMON_BUILD_DEPENDENCIES}
- python3 -m pip install --upgrade -r dev_requirements.txt
- ./autogen.sh
- ./configure --enable-local-build --enable-dev-tests
- make
- make pylint
mypy:
stage: stage1
script:
- dnf install -y ${COMMON_BUILD_DEPENDENCIES}
- python3 -m pip install --upgrade -r dev_requirements.txt
- ./autogen.sh
- ./configure --enable-local-build --enable-dev-tests
- make
- make mypy
ruby_tests:
stage: stage1
script:
- dnf install -y ${COMMON_BUILD_DEPENDENCIES}
- ./autogen.sh
- ./configure --enable-local-build
- make
- make pcsd-tests
python_tier0_tests:
stage: stage1
script:
- dnf install -y ${COMMON_BUILD_DEPENDENCIES}
- python3 -m pip install concurrencytest
- ./autogen.sh
- ./configure --enable-local-build
- make
- make tests_tier0
python_tier1_tests:
stage: stage2
needs:
- rpm_build
script:
- "dnf install -y
${COMMON_DEPENDENCIES}
python3-mock
fence-agents-scsi
fence-agents-apc
fence-agents-ipmilan
fence-virt
booth-site
rpms/pcs-*.rpm
"
- python3 -m pip install concurrencytest
- ./autogen.sh
- ./configure --enable-local-build --enable-destructive-tests --enable-tests-only
- rm -rf pcs pcsd pcs_bundled # make sure we are testing installed package
- pcs_test/suite -v --installed --tier1
python_smoke_tests:
stage: stage2
needs:
- rpm_build
script:
- "dnf install -y
${COMMON_DEPENDENCIES}
cracklib-dicts
passwd
procps-ng
rpms/pcs-*.rpm
"
- export GEM_HOME=/usr/lib64/pcsd/vendor/bundle/
- /usr/lib64/pcsd/pcsd & # start pcsd (ruby - thin)
- sleep 10 # wait for pcsd (ruby - thin) to start up properly
- /usr/sbin/pcsd & # start pcsd (python - tornado)
- sleep 10 # wait for pcsd (python - tornado) to start up properly
- ./autogen.sh
- ./configure --enable-local-build --enable-tests-only
- pcs_test/smoke.sh
artifacts:
paths:
- /var/log/pcsd/
when: on_failure