Skip to content

Commit

Permalink
[KOGITO-1673] - Operator should not take care of which micro version …
Browse files Browse the repository at this point in the history
…of images to deploy (apache#124)

Signed-off-by: spolti <[email protected]>
  • Loading branch information
spolti authored Apr 7, 2020
1 parent 62180ac commit 7794280
Showing 1 changed file with 38 additions and 2 deletions.
40 changes: 38 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
IMAGE_VERSION := $(shell cat image.yaml | egrep ^version | cut -d"\"" -f2)
SHORTENED_LATEST_VERSION := $(shell echo $(IMAGE_VERSION) | awk -F. '{print $$1"."$$2}')
BUILD_ENGINE := docker
.DEFAULT_GOAL := build

Expand All @@ -8,27 +9,51 @@ build: kogito-quarkus-ubi8 kogito-quarkus-jvm-ubi8 kogito-quarkus-ubi8-s2i kogit

kogito-quarkus-ubi8:
cekit -v build --overrides-file kogito-quarkus-overrides.yaml ${BUILD_ENGINE}
ifneq ($(findstring "rc",$(IMAGE_VERSION)),"rc")
${BUILD_ENGINE} tag quay.io/kiegroup/kogito-quarkus-ubi8:${IMAGE_VERSION} quay.io/kiegroup/kogito-quarkus-ubi8:${SHORTENED_LATEST_VERSION}
endif

kogito-quarkus-jvm-ubi8:
cekit -v build --overrides-file kogito-quarkus-jvm-overrides.yaml ${BUILD_ENGINE}
ifneq ($(findstring "rc",$(IMAGE_VERSION)),"rc")
${BUILD_ENGINE} tag quay.io/kiegroup/kogito-quarkus-jvm-ubi8:${IMAGE_VERSION} quay.io/kiegroup/kogito-quarkus-jvm-ubi8:${SHORTENED_LATEST_VERSION}
endif

kogito-quarkus-ubi8-s2i:
cekit -v build --overrides-file kogito-quarkus-s2i-overrides.yaml ${BUILD_ENGINE}
ifneq ($(findstring "rc",$(IMAGE_VERSION)),"rc")
${BUILD_ENGINE} tag quay.io/kiegroup/kogito-quarkus-ubi8-s2i:${IMAGE_VERSION} quay.io/kiegroup/kogito-quarkus-ubi8-s2i:${SHORTENED_LATEST_VERSION}
endif

kogito-springboot-ubi8:
cekit -v build --overrides-file kogito-springboot-overrides.yaml ${BUILD_ENGINE}
ifneq ($(findstring "rc",$(IMAGE_VERSION)),"rc")
${BUILD_ENGINE} tag quay.io/kiegroup/kogito-springboot-ubi8:${IMAGE_VERSION} quay.io/kiegroup/kogito-springboot-ubi8:${SHORTENED_LATEST_VERSION}
endif

kogito-springboot-ubi8-s2i:
cekit -v build --overrides-file kogito-springboot-s2i-overrides.yaml ${BUILD_ENGINE}
ifneq ($(findstring "rc",$(IMAGE_VERSION)),"rc")
${BUILD_ENGINE} tag quay.io/kiegroup/kogito-springboot-ubi8-s2i:${IMAGE_VERSION} quay.io/kiegroup/kogito-springboot-ubi8-s2i:${SHORTENED_LATEST_VERSION}
endif

kogito-data-index:
cekit -v build --overrides-file kogito-data-index-overrides.yaml ${BUILD_ENGINE}
ifneq ($(findstring "rc",$(IMAGE_VERSION)),"rc")
${BUILD_ENGINE} tag quay.io/kiegroup/kogito-data-index:${IMAGE_VERSION} quay.io/kiegroup/kogito-data-index:${SHORTENED_LATEST_VERSION}
endif

kogito-jobs-service:
cekit -v build --overrides-file kogito-jobs-service-overrides.yaml ${BUILD_ENGINE}
ifneq ($(findstring "rc",$(IMAGE_VERSION)),"rc")
${BUILD_ENGINE} tag quay.io/kiegroup/kogito-jobs-service:${IMAGE_VERSION} quay.io/kiegroup/kogito-jobs-service:${SHORTENED_LATEST_VERSION}
endif

kogito-management-console:
cekit -v build --overrides-file kogito-management-console-overrides.yaml ${BUILD_ENGINE}
ifneq ($(findstring "rc",$(IMAGE_VERSION)),"rc")
${BUILD_ENGINE} tag quay.io/kiegroup/kogito-management-console:${IMAGE_VERSION} quay.io/kiegroup/kogito-management-console:${SHORTENED_LATEST_VERSION}
endif

# Build and test all images
.PHONY: test
Expand All @@ -48,9 +73,9 @@ test:
.PHONY: push
push: build _push
_push:
docker push quay.io/kiegroup/kogito-quarkus-ubi8:$(IMAGE_VERSION)
docker push quay.io/kiegroup/kogito-quarkus-ubi8:${IMAGE_VERSION}
docker push quay.io/kiegroup/kogito-quarkus-ubi8:latest
docker push quay.io/kiegroup/kogito-quarkus-jvm-ubi8:$(IMAGE_VERSION)
docker push quay.io/kiegroup/kogito-quarkus-jvm-ubi8:${IMAGE_VERSION}
docker push quay.io/kiegroup/kogito-quarkus-jvm-ubi8:latest
docker push quay.io/kiegroup/kogito-quarkus-ubi8-s2i:${IMAGE_VERSION}
docker push quay.io/kiegroup/kogito-quarkus-ubi8-s2i:latest
Expand All @@ -64,6 +89,17 @@ _push:
docker push quay.io/kiegroup/kogito-jobs-service:latest
docker push quay.io/kiegroup/kogito-management-console:${IMAGE_VERSION}
docker push quay.io/kiegroup/kogito-management-console:latest
ifneq ($(findstring "rc",$(IMAGE_VERSION)),"rc")
@echo "${SHORTENED_LATEST_VERSION} will be pushed"
docker push quay.io/kiegroup/kogito-quarkus-ubi8:${SHORTENED_LATEST_VERSION}
docker push quay.io/kiegroup/kogito-quarkus-jvm-ubi8:${SHORTENED_LATEST_VERSION}
docker push quay.io/kiegroup/kogito-quarkus-ubi8-s2i:${SHORTENED_LATEST_VERSION}
docker push quay.io/kiegroup/kogito-springboot-ubi8:${SHORTENED_LATEST_VERSION}
docker push quay.io/kiegroup/kogito-springboot-ubi8-s2i:${SHORTENED_LATEST_VERSION}
docker push quay.io/kiegroup/kogito-data-index:${SHORTENED_LATEST_VERSION}
docker push quay.io/kiegroup/kogito-jobs-service:${SHORTENED_LATEST_VERSION}
docker push quay.io/kiegroup/kogito-management-console:${SHORTENED_LATEST_VERSION}
endif


# push staging images to quay.io, done before release, this requires permissions under kiegroup organization
Expand Down

0 comments on commit 7794280

Please sign in to comment.