Skip to content

Commit

Permalink
Update postsubmit to create docker images (envoyproxy#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienvas authored Feb 28, 2017
1 parent d71d5f3 commit f5281ad
Showing 1 changed file with 25 additions and 21 deletions.
46 changes: 25 additions & 21 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
Expand All @@ -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)
}
}
}

0 comments on commit f5281ad

Please sign in to comment.