Skip to content

Commit

Permalink
fixup! build openshift image
Browse files Browse the repository at this point in the history
  • Loading branch information
ImpSy committed Feb 29, 2024
1 parent 6e9a643 commit 66af453
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions .github/actions/release/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,45 @@ BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)

VERSION = $(shell git rev-parse --short=7 HEAD)
IMAGE_NAME = spark-operator
SPARK_BASE_IMAGE = gcr.io/datamechanics/custom/spark:openshift-spark-3.5-dev-amd64
TAG = $(VERSION)-openshift-spark-3.5-dev-amd64
SPARK_BASE_IMAGE = gcr.io/ocean-spark/spark:platform-3.4-gen20
TAG = $(VERSION)-gen20
SPARK_BASE_IMAGE_RH = gcr.io/datamechanics/custom/spark:openshift-spark-3.5-dev-amd64
TAG_RH = $(VERSION)-rh-dev

build:
build_linux:
docker buildx build --load \
-t $(REGISTRY)$(IMAGE_NAME):$(TAG) \
--build-arg SPARK_IMAGE=$(SPARK_BASE_IMAGE) .

push:
build_rh:
docker buildx build --load \
-t $(REGISTRY)$(IMAGE_NAME):$(TAG_RH) \
-f Dockerfile.rh \
--build-arg SPARK_IMAGE=$(SPARK_BASE_IMAGE_RH) .

build: build_linux build_rh

push_linux:
docker tag $(REGISTRY)$(IMAGE_NAME):$(TAG) $(REGISTRY)$(IMAGE_NAME):${BRANCH}
docker push $(REGISTRY)$(IMAGE_NAME):${BRANCH}
@if [ "$(BRANCH)" = "ocean-spark" ]; then \
docker push $(REGISTRY)$(IMAGE_NAME):$(TAG); \
fi

push_rh:
docker tag $(REGISTRY)$(IMAGE_NAME):$(TAG_RH) $(REGISTRY)$(IMAGE_NAME):${BRANCH}-rh
docker push $(REGISTRY)$(IMAGE_NAME):${BRANCH}-rh
@if [ "$(BRANCH)" = "ocean-spark" ]; then \
docker push $(REGISTRY)$(IMAGE_NAME):$(TAG_RH); \
fi

push: push_linux push_rh

show:
@echo "Images available:"
@if [ "$(BRANCH)" = "ocean-spark" ]; then \
echo "-> $(REGISTRY)$(IMAGE_NAME):$(TAG)"; \
echo "-> $(REGISTRY)$(IMAGE_NAME):$(TAG_RH)"; \
fi
@echo "-> $(REGISTRY)$(IMAGE_NAME):${BRANCH}"
@echo "-> $(REGISTRY)$(IMAGE_NAME):${BRANCH}-rh"

0 comments on commit 66af453

Please sign in to comment.