forked from istio/proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
67 lines (61 loc) · 1.56 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
#!groovy
@Library('testutils@stable-0ee5fd9')
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()
// Proxy does build work correctly with Hazelcast.
// Must use .bazelrc.jenkins
bazel.setVars('', '')
}
if (utils.runStage('PRESUBMIT')) {
presubmit(gitUtils, bazel)
}
if (utils.runStage('POSTSUBMIT')) {
postsubmit(gitUtils, bazel, utils)
}
}
def presubmit(gitUtils, bazel) {
buildNode(gitUtils) {
stage('Code Check') {
sh('script/check-license-headers')
sh('script/check-style')
}
bazel.updateBazelRc()
// TODO(sebastienvas): Fix Jenkins to build without cleaning
sh('bazel clean')
stage('Bazel Fetch') {
bazel.fetch('-k //...')
}
stage('Bazel Build') {
bazel.build('//...')
}
stage('Bazel Tests') {
bazel.test('//...')
}
stage('Push Test Binary') {
sh 'script/release-binary'
}
}
}
def postsubmit(gitUtils, bazel, utils) {
buildNode(gitUtils) {
bazel.updateBazelRc()
stage('Push Binary') {
sh 'script/release-binary'
}
// TODO(sebastienvas): Fix Jenkins to build without cleaning
sh('bazel clean')
stage('Docker Push') {
def images = 'envoy,envoy_debug'
def tags = "${gitUtils.GIT_SHORT_SHA},\$(date +%Y-%m-%d-%H.%M.%S),latest"
utils.publishDockerImages(images, tags, 'release')
}
}
}