pulls vars out to container.mk

This commit is contained in:
2026-07-01 17:29:16 +01:00
parent a601e93d00
commit 89165e9d88
3 changed files with 14 additions and 12 deletions
-7
View File
@@ -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")
+4 -4
View File
@@ -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: .
+10 -1
View File
@@ -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 =