diff --git a/Jenkinsfile b/Jenkinsfile index a4f52d0..9fe9bc3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,20 +13,16 @@ symfonyAppPipeline('ubuntu:22.04', [ String currentTag = sh(script: 'git tag --points-at HEAD | head -n 1', returnStdout: true).trim() // Retrieve default tag String defaultTag = sh(returnStdout: true, script: 'git describe --always').trim() - container.buildAndPublishImage([ - 'imageName': 'reg.cadoles.com/pcaseiro/myapplication-standalone', - // Use current tag or default tag if not defined - 'imageTag': defaultTag, - 'dockerfile': './misc/images/myapplication-standalone/Dockerfile', - 'dryRun': false - ]) - container.buildAndPublishImage([ - 'imageName': 'reg.cadoles.com/pcaseiro/myapplication-kube', - // Use current tag or default tag if not defined - 'imageTag': defaultTag, - 'dockerfile': './misc/images/myapplication-kube/Dockerfile', - 'dryRun': false - ]) + job('Building docker images') { + steps { + shell('make') + } + } + job('Publishing docker images') { + steps { + shell('make release') + } + } } } ] diff --git a/Makefile b/Makefile index 8dc52f5..d22673f 100644 --- a/Makefile +++ b/Makefile @@ -2,11 +2,11 @@ # Makefile for Cadoles SP ################################ -IMAGE_REPO ?= reg.cadoles.com/cadoles -IMAGE_VERSION ?= 0.0.1 - -DAY_SUFFIX_TAG ?= $(shell date +%Y%m%d) - COMMIT_ID ?= $(shell git rev-parse --short --verify HEAD) +CURRENT_BRANCH = $(shell git rev-parse --abbrev-ref HEAD | tr -c '[:alnum:]\n\r' '_'| tr '[:upper:]' '[:lower:]') + +IMAGE_REPO ?= reg.cadoles.com/cadoles +IMAGE_VERSION ?= 0.0.1-$(CURRENT_BRANCH) + include main.mk