-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
73 lines (60 loc) · 2.28 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
---
image: gitlab-registry.cern.ch/linuxsupport/cc7-base:latest
include:
- 'https://gitlab.cern.ch/linuxsupport/rpmci/raw/master/rpm-ci.yml'
- project: lb-experts/golbclient
file: .gitlab-ci_go.yml
variables:
KOJI_TAG: 'lb'
KOJI_TAG_7: 'ai7'
BUILD_7: 'True'
BUILD_8: 'True'
BUILD_8s: 'True'
DIST_7: .ai7
.patch_version: &patch_version |
RELEASE=`grep 'Release = "' lbclient.go | awk -F \" '{print $2}'`
VERSION=`grep 'Version = "' lbclient.go | awk -F \" '{print $2}'`
cat lbclient.spec.tpl | sed "s/#REPLACE_BY_VERSION#/$VERSION/" | sed "s/#REPLACE_BY_RELEASE#/$RELEASE/" > lbclient.spec
.rpm_deps:
before_script:
- *patch_version
- yum-builddep -y *.spec
build_srpm7:
before_script:
- *patch_version
- yum-builddep -y --disableplugin=protectbase,priorities *.spec
build_rpm7:
before_script:
- *patch_version
- yum-builddep -y --disableplugin=protectbase,priorities *.spec
.openTestPorts: &openTestPorts |
yum install iproute nmap-ncat git gcc -y
nc -l -p 22 &
nc -l -p 21 &
nc -l -p 2811 &
nc -l -p 80 &
nc -l -p 922 &
nc -l -u -p 922 &
nc -l 127.0.0.1 202 &
sleep 1
cat /proc/net/tcp
cat /proc/net/tcp6
if [ -d /builds ] ; then export PREFIX=/builds ; fi
ln -s $PREFIX/lb-experts/golbclient/scripts/lemon-cli /usr/sbin/lemon-cli
ln -s $PREFIX/lb-experts/golbclient/scripts/collectdctl /usr/bin/collectdctl
test-go15:
stage: test
before_script:
- *openTestPorts
test-lbclient-binary:
stage: test
script:
- yum -y install golang
- mkdir -p /usr/local/etc/
- echo "load constant 50000" > /usr/local/etc/lbclient.conf
- echo "lbalias=test.cern.ch" > /usr/local/etc/lbaliases
- cd /builds/lb-experts/golbclient
- go run lbclient.go | grep -Pzo ".1.3.6.1.4.1.96.255.1(\n)integer(\n)50000" | if [ $(wc -l) -eq 3 ]; then true; else false; fi
- echo "lbalias=test2.cern.ch" >> /usr/local/etc/lbaliases
- echo "load constant 40000" >> /usr/local/etc/lbclient.conf.test2.cern.ch
- go run lbclient.go | grep -Pzo ".1.3.6.1.4.1.96.255.1(\n)string(\n)test2.cern.ch=40000,test.cern.ch=50000" | if [ $(wc -l) -eq 3 ]; then true; else false; fi