Merge branch 'fix_mandatory_handling' into 'master'

fix mandatory handling

See merge request pub/make-deploy!8
This commit is contained in:
Andreas Neue 2024-06-17 09:44:24 +02:00
commit 4d8672aa8b
5 changed files with 9 additions and 8 deletions

View File

@ -1,5 +1,7 @@
DEPLOY_START_DELAY = 0 DEPLOY_START_DELAY = 0
MANDATORY = DEPLOY_NAME DEPLOY_HOSTS DEPLOY_PATH SSH_USER
-include secrets.mk -include secrets.mk
include config.mk include config.mk
-include $(DEPLOY_CONFIG_OVERRIDE) -include $(DEPLOY_CONFIG_OVERRIDE)
@ -20,9 +22,6 @@ deploy: mandatory cleanup prepare build test upload pre-deploy pre-local pull st
mandatory: mandatory:
@- echo "\n### mandatory check" @- echo "\n### mandatory check"
ifndef MANDATORY-$(DEPLOY_TYPE)
$(error MANDATORY-$(DEPLOY_TYPE) is not defined)
endif
@ $(foreach var,$(MANDATORY), \ @ $(foreach var,$(MANDATORY), \
if test -z "${$(var)}"; then \ if test -z "${$(var)}"; then \
echo "Missing mandatory variable: $(var)"; \ echo "Missing mandatory variable: $(var)"; \

2
apt.mk
View File

@ -1,4 +1,4 @@
MANDATORY-apt = DEPLOY_HOSTS SSH_USER APT_PACKAGES DEPLOY_NAME MANDATORY = $(MANDATORY) APT_PACKAGES
pull-apt: pull-apt:
# nop # nop

View File

@ -1,4 +1,6 @@
MANDATORY-compose = DEPLOY_HOSTS DEPLOY_TYPE SSH_USER DEPLOY_NAME ifdef DOCKER_LOGIN
MANDATORY = $(MANDATORY) DOCKER_USER DOCKER_PASS DOCKER_REGISTRY
endif
ifndef DOCKER_LOGIN ifndef DOCKER_LOGIN
DOCKER_LOGIN = 0 DOCKER_LOGIN = 0

View File

@ -1,5 +1,4 @@
MANDATORY-copy = DEPLOY_TYPE DEPLOY_HOSTS SSH_USER DEPLOY_PATH DEPLOY_NAME #MANDATORY = $(MANDATORY) DEPLOY_PATH
MANDATORY-simple = $(MANDATORY-copy)
# copy # copy
# #

3
tf.mk
View File

@ -1,4 +1,5 @@
MANDATORY-tf = MANDATORY = $(MANDATORY) TF_FLAGS
# tf # tf
# #
# deploys via tf apply # deploys via tf apply