From 8927453138ee02bec8e693989181663b68a3b22e Mon Sep 17 00:00:00 2001 From: Patrick Valsecchi Date: Fri, 9 Jun 2017 11:39:06 +0200 Subject: [PATCH] Generate the latest docker image --- Jenkinsfile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 89a4fd5b3..cc935c84b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -39,4 +39,15 @@ dockerBuild { } } } + + if (env.BRANCH_NAME == 'master') { + stage("publish latest on docker hub") { + withCredentials([[$class : 'UsernamePasswordMultiBinding', credentialsId: 'dockerhub', + usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) { + sh 'docker login -u "$USERNAME" -p "$PASSWORD"' + docker.image('camptocamp/c2cwsgiutils:latest').push() + sh 'rm -rf ~/.docker*' + } + } + } }