Skip to content

Commit f5281ad

Browse files
authored
Update postsubmit to create docker images (istio#132)
1 parent d71d5f3 commit f5281ad

File tree

1 file changed

+25
-21
lines changed

1 file changed

+25
-21
lines changed

Jenkinsfile

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,20 @@ def gitUtils = new GitUtilities()
1111
def utils = new Utilities()
1212
def bazel = new Bazel()
1313

14-
node {
15-
gitUtils.initialize()
16-
// Proxy does build work correctly with Hazelcast.
17-
// Must use .bazelrc.jenkins
18-
bazel.setVars('', '')
19-
}
20-
2114
mainFlow(utils) {
22-
if (utils.runStage('PRESUBMIT')) {
23-
def success = true
24-
utils.updatePullRequest('run')
25-
try {
15+
pullRequest(utils) {
16+
node {
17+
gitUtils.initialize()
18+
// Proxy does build work correctly with Hazelcast.
19+
// Must use .bazelrc.jenkins
20+
bazel.setVars('', '')
21+
}
22+
23+
if (utils.runStage('PRESUBMIT')) {
2624
presubmit(gitUtils, bazel)
27-
} catch (Exception e) {
28-
success = false
29-
throw e
30-
} finally {
31-
utils.updatePullRequest('verify', success)
3225
}
33-
}
34-
if (utils.runStage('POSTSUBMIT')) {
35-
buildNode(gitUtils) {
36-
bazel.updateBazelRc()
37-
sh 'script/release-binary'
26+
if (utils.runStage('POSTSUBMIT')) {
27+
postsubmit(gitUtils, bazel, utils)
3828
}
3929
}
4030
}
@@ -59,3 +49,17 @@ def presubmit(gitUtils, bazel) {
5949
}
6050
}
6151
}
52+
53+
def postsubmit(gitUtils, bazel, utils) {
54+
buildNode(gitUtils) {
55+
bazel.updateBazelRc()
56+
stage('Push Binary') {
57+
sh 'script/release-binary'
58+
}
59+
stage('Docker Push') {
60+
def images = 'proxy,proxy_debug'
61+
def tags = "${gitUtils.GIT_SHORT_SHA},\$(date +%Y-%m-%d-%H.%M.%S),latest"
62+
utils.publishDockerImages(images, tags)
63+
}
64+
}
65+
}

0 commit comments

Comments
 (0)