forked from GuanceCloud/datakit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
136 lines (126 loc) · 3.21 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
before_script:
- rm -rf /root/go/src/gitlab.jiagouyun.com/cloudcare-tools/datakit
- mkdir -p /root/go/src/gitlab.jiagouyun.com/cloudcare-tools/datakit
- cp -r ./. /root/go/src/gitlab.jiagouyun.com/cloudcare-tools/datakit
- cd /root/go/src/gitlab.jiagouyun.com/cloudcare-tools/datakit
- source ~/.ossenv
- echo $DK_BPF_KERNEL_SRC_PATH
- export PATH=/usr/local/go1.18.3/bin:$PATH
- export GOROOT=/usr/local/go1.18.3
- go version
variables:
PROJECT: "datakit"
CI_VERSION: "1.4.11"
TEST_VERSION: "1.999.0"
stages:
- test
- deploy_ebpf
- deploy
ci_lint_and_unit_test:
stage: deploy
resource_group: production
only:
- /^\d+-iss.*$/
script:
# only run lint and unit-testing
- make clean
- make lint
- make all_test
tags:
- cloudcare-ft
test-datakit-production:
stage: test
resource_group: production
only:
- unstable
- master
script:
- make clean
- make production_notify GIT_BRANCH=$CI_COMMIT_BRANCH VERSION="$CI_VERSION"
- make lint
- make all_test
tags:
- cloudcare-ft
test-datakit-testing:
stage: test
resource_group: production
only:
- testing
- hotfix
- /^testing-.*$/
script:
- make clean
- make testing_notify GIT_BRANCH=$CI_COMMIT_BRANCH
- make lint
- make all_test
tags:
- cloudcare-ft
release-ebpf-testing:
stage: deploy_ebpf
resource_group: production
needs: [test-datakit-testing]
image: vircoys/datakit-developer:1.4
only:
- testing
- hotfix
- /^testing-.*$/
script:
- make clean
- make pub_epbf_testing DATAKIT_EBPF_ARCHS="linux/arm64" GIT_BRANCH=$CI_COMMIT_BRANCH
tags:
- dk-arm-docker-runner
release-ebpf-production:
stage: deploy_ebpf
resource_group: production
needs: [test-datakit-production]
image: vircoys/datakit-developer:1.4
only:
- master
- unstable
script:
- make clean
- make pub_ebpf_production DATAKIT_EBPF_ARCHS="linux/arm64" GIT_BRANCH=$CI_COMMIT_BRANCH VERSION="$CI_VERSION"
tags:
- dk-arm-docker-runner
release-testing:
stage: deploy
resource_group: production
needs: [test-datakit-testing, release-ebpf-testing]
only:
- testing
- hotfix
- /^testing-.*$/
script:
# building && publish testing
- make clean
- make testing GIT_BRANCH=$CI_COMMIT_BRANCH # do not set VERSION here, use git version
- make check_testing_conf_compatible
- make testing_image IGN_EBPF_INSTALL_ERR=1
tags:
- cloudcare-ft
release-stable:
stage: deploy
resource_group: production
needs: [test-datakit-production, release-ebpf-production]
only:
- master
script:
- make clean
- make production GIT_BRANCH=$CI_COMMIT_BRANCH VERSION="$CI_VERSION" # update the version on each release
- make check_production_conf_compatible
- make pub_conf_samples
- make production_image GIT_BRANCH=$CI_COMMIT_BRANCH VERSION="$CI_VERSION"
tags:
- cloudcare-ft
# for testing current issue, should delete after merge into master
current-testing:
stage: deploy
resource_group: production
only:
- /^xxx-.*$/
script:
- make clean
- make testing GIT_BRANCH=$CI_COMMIT_BRANCH VERSION="$TEST_VERSION"
- make testing_image VERSION="$TEST_VERSION"
tags:
- cloudcare-ft