Skip to content

Commit

Permalink
Fix pushing latest and tagged releases. Closes #128
Browse files Browse the repository at this point in the history
  • Loading branch information
poikilotherm committed Jan 24, 2020
1 parent f590d7e commit a257a00
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 17 deletions.
20 changes: 12 additions & 8 deletions docker/dataverse-k8s/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,21 @@ pipeline {
environment {
dockerfile = "./docker/dataverse-k8s/glassfish/Dockerfile"
context = "."
imagetag = "build-${env.BUILD_ID}"
imagetag = "build-${env.BRANCH_NAME}"
hublogin = "dockerhub-dataversebot"
registry = "https://registry.hub.docker.com"
}
triggers { cron('H H(0-4) * * *') }
stages {
stage('checkout') {
steps { checkout scm }
}
stage('build') {
when {
anyOf {
changeset "docker/dataverse-k8s/**"
triggeredBy 'TimerTrigger'
tag "v4.*"
tag ""
}
}
steps {
Expand All @@ -38,16 +41,14 @@ pipeline {
anyOf {
changeset "docker/dataverse-k8s/**"
triggeredBy 'TimerTrigger'
tag "v4.*"
}
anyOf {
branch 'master'
tag "v4.*"
tag ""
}
}
parallel {
stage('release') {
when { buildingTag() }
when {
tag "v4.*"
}
environment {
imageTag = "${TAG_NAME.substring(1)}"
}
Expand All @@ -60,6 +61,9 @@ pipeline {
}
}
stage('latest') {
when {
branch 'master'
}
steps {
script {
docker.withRegistry("${env.registry}", "${env.hublogin}") {
Expand Down
22 changes: 13 additions & 9 deletions docker/solr-k8s/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,26 @@ pipeline {
agent any
environment {
context = "docker/solr-k8s"
imagetag = "build-${env.BUILD_ID}"
imagetag = "build-${env.BRANCH_NAME}"
hublogin = "dockerhub-dataversebot"
registry = "https://registry.hub.docker.com"
}
triggers { cron('H H(0-4) * * *') }
stages {
stage('checkout') {
steps { checkout scm }
}
stage('build') {
when {
anyOf {
changeset "docker/solr-k8s/**"
triggeredBy 'TimerTrigger'
tag "v4.*"
tag ""
}
}
steps {
script {
docker_image = docker.build("iqss/solr-k8s:${env.imagetag}", "--pull ${env.context}")
docker_image = docker.build("iqss/solr-k8s:${env.imagetag}", "--pull -f ${env.dockerfile} ${env.context}")
}
}
}
Expand All @@ -37,16 +40,14 @@ pipeline {
anyOf {
changeset "docker/solr-k8s/**"
triggeredBy 'TimerTrigger'
tag "v4.*"
}
anyOf {
branch 'master'
tag "v4.*"
tag ""
}
}
parallel {
stage('release') {
when { buildingTag() }
when {
tag "v4.*"
}
environment {
imageTag = "${TAG_NAME.substring(1)}"
}
Expand All @@ -59,6 +60,9 @@ pipeline {
}
}
stage('latest') {
when {
branch 'master'
}
steps {
script {
docker.withRegistry("${env.registry}", "${env.hublogin}") {
Expand Down

0 comments on commit a257a00

Please sign in to comment.