Skip to content

Commit

Permalink
Reworked tagging of images to use correct version
Browse files Browse the repository at this point in the history
Images are tagged using midPoint version insted of using always tag latest
  • Loading branch information
Slavek Licehammer committed Aug 30, 2021
1 parent be3b3c8 commit 83b06ea
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 16 deletions.
17 changes: 11 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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")
}
}
}
}
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion common.bash
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion demo/grouper/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion demo/grouper/midpoint_server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM tier/midpoint:latest
ARG tag=4.3.2-SNAPSHOT

FROM tier/midpoint:${tag}

MAINTAINER info@evolveum.com

Expand Down
2 changes: 1 addition & 1 deletion demo/postgresql/docker-compose-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion demo/postgresql/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion demo/shibboleth/docker-compose-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 4 additions & 1 deletion demo/shibboleth/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion demo/shibboleth/midpoint_server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM tier/midpoint:latest
ARG tag=4.3.2-SNAPSHOT

FROM tier/midpoint:${tag}

MAINTAINER info@evolveum.com

Expand Down
2 changes: 1 addition & 1 deletion demo/simple/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 83b06ea

Please sign in to comment.