generated from unkin/docker-template
All checks were successful
Build / build (pull_request) Successful in 2m8s
- manage almalinux 8 and 9 deployments
49 lines
1.6 KiB
Makefile
49 lines
1.6 KiB
Makefile
# Variables
|
|
GIT_COMMIT := $(shell git rev-parse --short HEAD)
|
|
DATE_TAG := $(shell date +%Y%m%d)
|
|
REGISTRY := git.query.consul
|
|
OWNER := unkin
|
|
|
|
# List of releases (directories under ./release)
|
|
RELEASES := $(shell find release -mindepth 1 -maxdepth 1 -type d -exec basename {} \;)
|
|
|
|
# Build all releases
|
|
build: $(addprefix build-,$(RELEASES))
|
|
|
|
# Tag all releases
|
|
tag: $(addprefix tag-,$(RELEASES))
|
|
|
|
# Push all releases
|
|
push: $(addprefix push-,$(RELEASES))
|
|
|
|
# Clean dangling images
|
|
clean:
|
|
docker image prune -f
|
|
|
|
# List all available releases
|
|
list:
|
|
@echo "Available releases:"
|
|
@echo $(RELEASES) | tr ' ' '\n'
|
|
|
|
# Build a specific release
|
|
build-%:
|
|
$(info Building almalinux$*-jupyterinstance Docker image)
|
|
docker build --network=host -t $(REGISTRY)/$(OWNER)/almalinux$*-jupyterinstance -f release/$*/Dockerfile release/$*
|
|
|
|
# Tag a specific release
|
|
tag-%:
|
|
$(info Tagging almalinux$*-jupyterinstance Docker image)
|
|
docker tag $(REGISTRY)/$(OWNER)/almalinux$*-jupyterinstance $(REGISTRY)/$(OWNER)/almalinux$*-jupyterinstance:$(GIT_COMMIT)
|
|
docker tag $(REGISTRY)/$(OWNER)/almalinux$*-jupyterinstance $(REGISTRY)/$(OWNER)/almalinux$*-jupyterinstance:$(DATE_TAG)
|
|
docker tag $(REGISTRY)/$(OWNER)/almalinux$*-jupyterinstance $(REGISTRY)/$(OWNER)/almalinux$*-jupyterinstance:latest
|
|
|
|
# Push a specific release
|
|
push-%: tag-%
|
|
$(info Pushing almalinux$*-jupyterinstance Docker image)
|
|
docker push $(REGISTRY)/$(OWNER)/almalinux$*-jupyterinstance:$(GIT_COMMIT)
|
|
docker push $(REGISTRY)/$(OWNER)/almalinux$*-jupyterinstance:$(DATE_TAG)
|
|
docker push $(REGISTRY)/$(OWNER)/almalinux$*-jupyterinstance:latest
|
|
|
|
# Default target
|
|
default: build
|