Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Reworked tagging of images to use correct version
Images are tagged using midPoint version insted of using always tag latest
Slavek Licehammer committed Aug 30, 2021
1 parent be3b3c8 commit 83b06ea
Showing 11 changed files with 34 additions and 16 deletions.
17 changes: 11 additions & 6 deletions Jenkinsfile
@@ -11,11 +11,7 @@ pipeline {
script {
maintainer = maintain()
imagename = imagename()
if (env.BRANCH_NAME == "master") {
tag = "latest"
} else {
tag = env.BRANCH_NAME
}
tag = tag()
if (!imagename) {
echo "You must define imagename in common.bash"
currentBuild.result = 'FAILURE'
@@ -75,8 +71,12 @@ pipeline {
steps {
script {
docker.withRegistry('https://registry.hub.docker.com/', "dockerhub-$maintainer") {
def baseImg = docker.build("$maintainer/$imagename")
def baseImg = docker.image("$maintainer/$imagename:$tag")
baseImg.push("$tag")

if (env.BRANCH_NAME == "master") {
baseImg.push("latest")
}
}
}
}
@@ -110,6 +110,11 @@ def imagename() {
matcher ? matcher[0][1] : null
}

def tag() {
def matcher = readFile('common.bash') =~ 'tag="(.+)"'
matcher ? matcher[0][1] : latest
}

def handleError(String message) {
echo "${message}"
currentBuild.setResult("FAILED")
2 changes: 1 addition & 1 deletion common.bash
@@ -1,3 +1,3 @@
maintainer="tier"
imagename="midpoint"
tag="latest"
tag="4.3.2-SNAPSHOT"
2 changes: 1 addition & 1 deletion demo/extrepo/docker-compose.yml
@@ -2,7 +2,7 @@ version: "3.3"

services:
midpoint_server:
image: tier/midpoint:latest
image: tier/midpoint:${tag:-4.3.2-SNAPSHOT}
ports:
- 8443:443
environment:
5 changes: 4 additions & 1 deletion demo/grouper/docker-compose.yml
@@ -188,7 +188,10 @@ services:
- midpoint_data:/var/lib/postgresql/data

midpoint_server:
build: ./midpoint_server/
build:
context: ./midpoint_server/
args:
tag: ${tag:-4.3.2-SNAPSHOT}
depends_on:
- midpoint_data
ports:
4 changes: 3 additions & 1 deletion demo/grouper/midpoint_server/Dockerfile
@@ -1,4 +1,6 @@
FROM tier/midpoint:latest
ARG tag=4.3.2-SNAPSHOT

FROM tier/midpoint:${tag}

MAINTAINER info@evolveum.com

2 changes: 1 addition & 1 deletion demo/postgresql/docker-compose-tests.yml
@@ -20,7 +20,7 @@ services:
- midpoint_data:/var/lib/postgresql/data

midpoint_server:
image: tier/midpoint:latest
image: tier/midpoint:${tag:-4.3.2-SNAPSHOT}
ports:
- 8443:443
environment:
2 changes: 1 addition & 1 deletion demo/postgresql/docker-compose.yml
@@ -17,7 +17,7 @@ services:
- midpoint_data:/var/lib/postgresql/data

midpoint_server:
image: tier/midpoint:latest
image: tier/midpoint:${tag:-4.3.2-SNAPSHOT}
ports:
- 8443:443
environment:
5 changes: 4 additions & 1 deletion demo/shibboleth/docker-compose-tests.yml
@@ -20,7 +20,10 @@ services:
- midpoint_data:/var/lib/postgresql/data

midpoint_server:
build: ./midpoint_server/
build:
context: ./midpoint_server/
args:
tag: ${tag:-4.3.2-SNAPSHOT}
ports:
- 8443:443
environment:
5 changes: 4 additions & 1 deletion demo/shibboleth/docker-compose.yml
@@ -17,7 +17,10 @@ services:
- midpoint_data:/var/lib/postgresql/data

midpoint_server:
build: ./midpoint_server/
build:
context: ./midpoint_server/
args:
tag: ${tag:-4.3.2-SNAPSHOT}
command: /usr/local/bin/startup.sh
ports:
- 8443:443
4 changes: 3 additions & 1 deletion demo/shibboleth/midpoint_server/Dockerfile
@@ -1,4 +1,6 @@
FROM tier/midpoint:latest
ARG tag=4.3.2-SNAPSHOT

FROM tier/midpoint:${tag}

MAINTAINER info@evolveum.com

2 changes: 1 addition & 1 deletion demo/simple/docker-compose.yml
@@ -17,7 +17,7 @@ services:
- midpoint_data:/var/lib/postgresql/data

midpoint_server:
image: tier/midpoint:latest
image: tier/midpoint:${tag:-4.3.2-SNAPSHOT}
ports:
- 8443:443
environment:

0 comments on commit 83b06ea

Please sign in to comment.