diff options
| author | Joe Carstairs <me@joeac.net> | 2026-07-01 17:29:16 +0100 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-07-01 17:29:16 +0100 |
| commit | 89165e9d889f3dc0a0a40290fad21b6ffbaa3782 (patch) | |
| tree | d02b20a132f7ebfd438d417ba8434ae68519d6e7 | |
| parent | a601e93d00ba635cca832902935966e5896f8f14 (diff) | |
pulls vars out to container.mk
| -rw-r--r-- | Makefile | 7 | ||||
| -rw-r--r-- | compose.yml | 8 | ||||
| -rw-r--r-- | container.mk | 11 |
3 files changed, 14 insertions, 12 deletions
@@ -4,13 +4,7 @@ include config.mk # VARIABLES # ############# -CPU_ARCH := $(if $(shell which arch 2>/dev/null),\ - $(shell arch),\ - $(shell lscpu | grep ^Architecture: | sed "s/^Architecture:[[:space:]]*\([[:alnum:][:punct:]]\+\).*/\1/")) HOSTNAME := $(shell cat /etc/hostname) -IMAGE_PREFIX := $(if $(filter armv7%,$(CPU_ARCH)),armv7/) -REGISTRY_DOMAIN := git.joeac.net -REGISTRY_USER := joeac MODULES_pi-broughton := http gemini smtp vaultwarden ln MODULES_blade-canongate := etherpad MASTER_NODE := pi-broughton @@ -31,7 +25,6 @@ RESTART_NGINX := sudo rc-service nginx restart # FUNCTIONS # ############# -container_image_name = $(REGISTRY_DOMAIN)/$(REGISTRY_USER)/joeac.net-$(module) dyndns_module_target = $(if $(SUBDOMAIN_$(module)),/etc/periodic/daily/dyndns-$(SUBDOMAIN_$(module)).joeac.net) openrc_module_target = $(if $(filter $(COMPOSE_SERVICES),$(module)),~/.config/rc/init.d/joeac.net.$(module)) install_submake_file = $(shell [ -f "$(module)/install.mk" ] && echo "$(module)/install.mk") diff --git a/compose.yml b/compose.yml index 1aac108..8a8c6fe 100644 --- a/compose.yml +++ b/compose.yml @@ -1,6 +1,6 @@ services: gemini: - image: git.joeac.net/joeac/${CONTAINER_PREFIX}joeac.net-gemini + image: git.joeac.net/joeac/${IMAGE_PREFIX}joeac.net-gemini container_name: joeac.net-gemini build: context: . @@ -9,7 +9,7 @@ services: - "${GEMINI_PORT}:1965" http: - image: git.joeac.net/joeac/${CONTAINER_PREFIX}joeac.net-http + image: git.joeac.net/joeac/${IMAGE_PREFIX}joeac.net-http container_name: joeac.net-http build: context: . @@ -30,7 +30,7 @@ services: - "${HTTP_PORT}:80" etherpad: - image: git.joeac.net/joeac/${CONTAINER_PREFIX}joeac.net-etherpad + image: git.joeac.net/joeac/${IMAGE_PREFIX}joeac.net-etherpad container_name: joeac.net-etherpad build: context: . @@ -48,7 +48,7 @@ services: - "${ETHERPAD_PORT}:9001" smtp: - image: git.joeac.net/joeac/${CONTAINER_PREFIX}joeac.net-smtp + image: git.joeac.net/joeac/${IMAGE_PREFIX}joeac.net-smtp container_name: joeac.net-smtp build: context: . diff --git a/container.mk b/container.mk index 3b1e5ae..101e4e4 100644 --- a/container.mk +++ b/container.mk @@ -1,7 +1,16 @@ +CPU_ARCH := $(if $(shell which arch 2>/dev/null),\ + $(shell arch),\ + $(shell lscpu | grep ^Architecture: | sed "s/^Architecture:[[:space:]]*\([[:alnum:][:punct:]]\+\).*/\1/")) +IMAGE_PREFIX := $(if $(filter armv7%,$(CPU_ARCH)),armv7/) +REGISTRY_DOMAIN := git.joeac.net +REGISTRY_USER := joeac + +container_image_name = $(REGISTRY_DOMAIN)/$(REGISTRY_USER)/$(CONTAINER_PREFIX)joeac.net-$(module) + define build_module_rule = .PHONY: build_$(module) build_$(module): make_$(module) $(module).Dockerfile - podman-compose build $(module) + IMAGE_PREFIX="$(IMAGE_PREFIX)" podman-compose build $(module) endef define push_module_rule = |
