From 3a9dc1ae213fe1c6309d600dd8fa3eeb4206c35e Mon Sep 17 00:00:00 2001 From: Philippe Caseiro Date: Mon, 19 Jun 2023 16:09:06 +0200 Subject: [PATCH] fup-try-010 --- Jenkinsfile | 24 ++++++++++-------------- Makefile | 10 +++++----- 2 files changed, 15 insertions(+), 19 deletions(-) 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