-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.gitlab-ci.yml
69 lines (61 loc) · 1.88 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
image: golang:1.20
stages:
- build
- test
- dependency
after_script:
- cd $CI_PROJECT_DIR
- sudo ./ci/cleanup.sh
build:
tags:
- sm_ci
stage: build
script:
- echo "------- Start Build -------"
- /usr/local/go/bin/go build
install_cni:
tags:
- sm_ci
stage: build
script:
- mkdir -p $HOME/go/src/
- cd $HOME/go/src/
- git clone https://${AOS_FIREWALL_TOKEN}@gitpct.epam.com/epmd-aepr/aos_cni_firewall.git
- cd $HOME/go/src/aos_cni_firewall/plugins/meta/aos-firewall
- /usr/local/go/bin/go build
- sudo cp -f $HOME/go/src/aos_cni_firewall/plugins/meta/aos-firewall/aos-firewall /opt/cni/bin
- cd $HOME/go/src/
- git clone https://${AOS_DNS_TOKEN}@gitpct.epam.com/epmd-aepr/aos_cni_dns.git
- cd $HOME/go/src/aos_cni_dns/plugins/meta/dnsname/
- /usr/local/go/bin/go build
- sudo cp -f $HOME/go/src/aos_cni_dns/plugins/meta/dnsname/dnsname /opt/cni/bin
after_script:
- rm -rf $HOME/go/src/aos_cni_firewall
- rm -rf $HOME/go/src/aos_cni_dns
test:
tags:
- sm_ci
stage: test
script:
- sudo iptables -P FORWARD ACCEPT
- echo "------- Run Unit tests -------"
- sudo -E /usr/local/go/bin/go test $(/usr/local/go/bin/go list ./... | grep -v "/vendor") -p=1 -failfast -v -coverprofile .testCoverage.txt
- /usr/local/go/bin/go tool cover -func=.testCoverage.txt
- sudo rm .testCoverage.txt
test_crun:
tags:
- sm_ci
stage: test
script:
- echo "------- Run Launcher Unit tests with crun -------"
- sudo -E AOS_RUNNER=crun /usr/local/go/bin/go test aos_servicemanager/launcher -p=1 -failfast -v
whitesource:
only:
refs:
- master
- develop
tags:
- sm_ci
stage: dependency
script:
- java -jar /usr/bin/wss-unified-agent.jar -apiKey $WSS_API_KEY -projectToken $WSS_SM_TOKEN -userKey $WSS_USER_KEY -c ./ci/wss-sm.conf -d ./ -scanComment $CI_COMMIT_SHORT_SHA