From c4611afa25bcd917dc0b56915fe03e320830ab39 Mon Sep 17 00:00:00 2001 From: Sebastien Vas Date: Tue, 28 Feb 2017 10:24:23 -0800 Subject: [PATCH] Update postsubmit to create docker images --- Jenkinsfile | 46 +++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index db6abcaa5f4..a8ded63359b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,30 +11,20 @@ def gitUtils = new GitUtilities() def utils = new Utilities() def bazel = new Bazel() -node { - gitUtils.initialize() - // Proxy does build work correctly with Hazelcast. - // Must use .bazelrc.jenkins - bazel.setVars('', '') -} - mainFlow(utils) { - if (utils.runStage('PRESUBMIT')) { - def success = true - utils.updatePullRequest('run') - try { + pullRequest(utils) { + node { + gitUtils.initialize() + // Proxy does build work correctly with Hazelcast. + // Must use .bazelrc.jenkins + bazel.setVars('', '') + } + + if (utils.runStage('PRESUBMIT')) { presubmit(gitUtils, bazel) - } catch (Exception e) { - success = false - throw e - } finally { - utils.updatePullRequest('verify', success) } - } - if (utils.runStage('POSTSUBMIT')) { - buildNode(gitUtils) { - bazel.updateBazelRc() - sh 'script/release-binary' + if (utils.runStage('POSTSUBMIT')) { + postsubmit(gitUtils, bazel, utils) } } } @@ -59,3 +49,17 @@ def presubmit(gitUtils, bazel) { } } } + +def postsubmit(gitUtils, bazel, utils) { + buildNode(gitUtils) { + bazel.updateBazelRc() + stage('Push Binary') { + sh 'script/release-binary' + } + stage('Docker Push') { + def images = 'proxy,proxy_debug' + def tags = "${gitUtils.GIT_SHORT_SHA},\$(date +%Y-%m-%d-%H.%M.%S),latest" + utils.publishDockerImages(images, tags) + } + } +} \ No newline at end of file