Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update postsubmit to create docker images #132

Merged
merged 2 commits into from
Feb 28, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
}
}
}