forked from istio/old_pilot_repo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
84 lines (76 loc) · 2.03 KB
/
Jenkinsfile
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
#!groovy
@Library('testutils@stable-afad32f')
import org.istio.testutils.Utilities
import org.istio.testutils.GitUtilities
import org.istio.testutils.Bazel
// Utilities shared amongst modules
def gitUtils = new GitUtilities()
def utils = new Utilities()
def bazel = new Bazel()
mainFlow(utils) {
node {
gitUtils.initialize()
bazel.setVars()
}
if (utils.runStage('PRESUBMIT')) {
presubmit(gitUtils, bazel, utils)
}
if (utils.runStage('POSTSUBMIT')) {
postsubmit(gitUtils, bazel, utils)
}
}
def presubmit(gitUtils, bazel, utils) {
goBuildNode(gitUtils, 'istio.io/manager') {
bazel.updateBazelRc()
utils.initTestingCluster()
stage('Bazel Build') {
// Use Testing cluster
sh('ln -s ~/.kube/config platform/kube/')
sh('bin/install-prereqs.sh')
bazel.fetch('-k //...')
bazel.build('//...')
}
stage('Go Build') {
sh('bin/init.sh')
}
stage('Code Check') {
sh('bin/check.sh')
}
stage('Bazel Tests') {
bazel.test('//...')
}
stage('Code Coverage') {
sh('bin/codecov.sh')
utils.publishCodeCoverage('MANAGER_CODECOV_TOKEN')
}
stage('Integration Tests') {
timeout(15) {
sh('bin/e2e.sh -tag alpha' + gitUtils.GIT_SHA + ' -v 2')
}
}
}
}
def postsubmit(gitUtils, bazel, utils) {
goBuildNode(gitUtils, 'istio.io/manager') {
bazel.updateBazelRc()
utils.initTestingCluster()
sh('ln -s ~/.kube/config platform/kube/')
stage('Code Coverage') {
sh('bin/install-prereqs.sh')
bazel.test('//...')
sh('bin/init.sh')
sh('bin/codecov.sh')
utils.publishCodeCoverage('MANAGER_CODECOV_TOKEN')
}
stage('Docker Push') {
def images = 'init,init_debug,app,app_debug,runtime,runtime_debug'
def tags = "${gitUtils.GIT_SHORT_SHA},\$(date +%Y-%m-%d-%H.%M.%S),latest"
utils.publishDockerImages(images, tags)
}
stage('Integration Tests') {
timeout(30) {
sh('bin/e2e.sh -count 10 -debug -tag alpha' + gitUtils.GIT_SHA + ' -v 2')
}
}
}
}