Skip to content

Commit

Permalink
fixed jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
toschoch committed Dec 9, 2018
1 parent a808e5c commit 0206d3b
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions {{cookiecutter.project_slug}}/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,29 @@ def isTag() {
}
return false
}
pipeline {
stages {
stage('Checkout') {
checkout scm
node('docker') {
stage('Checkout') {
checkout scm
}

stage('Build Image') {
withCredentials([
usernamePassword(credentialsId: 'docker public',
usernameVariable: 'USERNAME',
passwordVariable: 'PASSWORD')]) {
def builtImage = docker.build("${USERNAME}/{{cookiecutter.project_slug}}",".")
}

stage('Build Image') {
}

stage('Push Image') {
docker.withRegistry('','docker public') {
withCredentials([
usernamePassword(credentialsId: 'docker public',
usernameVariable: 'USERNAME',
passwordVariable: 'PASSWORD')]) {
def builtImage = docker.build("${USERNAME}/{{cookiecutter.project_slug}}")
}
}

stage('Push Image') {
when { tag "release-*" }
docker.withRegistry('https://hub.docker.com/','docker public') {
builtImage.push()
}
def builtImage = docker.build("${USERNAME}/{{cookiecutter.project_slug}}",".")
builtImage.push()
}
}
}
}

0 comments on commit 0206d3b

Please sign in to comment.