All checks were successful
Build / build (pull_request) Successful in 1m36s
- create releases/{version} directories
- move almalinux8 to releases/8
- create almalinx9 build
- update makefile to work with multiple versions
50 lines
1.5 KiB
Makefile
50 lines
1.5 KiB
Makefile
# Variables
|
|
GIT_COMMIT := $(shell git rev-parse --short HEAD)
|
|
DATE_TAG := $(shell date +%Y%m%d)
|
|
IMAGE_NAME := almalinux
|
|
REGISTRY := git.query.consul
|
|
OWNER := unkin
|
|
|
|
# List of releases (directories under ./release)
|
|
RELEASES := $(shell find release -mindepth 1 -maxdepth 1 -type d -exec basename {} \;)
|
|
|
|
# Default target (build all images)
|
|
default: build-all
|
|
|
|
# List all available releases
|
|
list:
|
|
@echo "Available releases:"
|
|
@echo $(RELEASES) | tr ' ' '\n'
|
|
|
|
# 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
|
|
|
|
# Build a specific release
|
|
build-%:
|
|
$(info Building AlmaLinux $* Docker image)
|
|
docker build --network=host -t $(REGISTRY)/$(OWNER)/$(IMAGE_NAME)$* -f release/$*/Dockerfile release/$*
|
|
|
|
# Tag a specific release
|
|
tag-%:
|
|
$(info Tagging AlmaLinux $* Docker image)
|
|
docker tag $(REGISTRY)/$(OWNER)/$(IMAGE_NAME)$* $(REGISTRY)/$(OWNER)/$(IMAGE_NAME)$*:$(GIT_COMMIT)
|
|
docker tag $(REGISTRY)/$(OWNER)/$(IMAGE_NAME)$* $(REGISTRY)/$(OWNER)/$(IMAGE_NAME)$*:$(DATE_TAG)
|
|
docker tag $(REGISTRY)/$(OWNER)/$(IMAGE_NAME)$* $(REGISTRY)/$(OWNER)/$(IMAGE_NAME)$*:latest
|
|
|
|
# Push a specific release
|
|
push-%: tag-%
|
|
$(info Pushing AlmaLinux $* Docker image)
|
|
docker push $(REGISTRY)/$(OWNER)/$(IMAGE_NAME)$*:$(GIT_COMMIT)
|
|
docker push $(REGISTRY)/$(OWNER)/$(IMAGE_NAME)$*:$(DATE_TAG)
|
|
docker push $(REGISTRY)/$(OWNER)/$(IMAGE_NAME)$*:latest
|