add build and test targets

This commit is contained in:
Andreas Neue 2022-11-25 10:16:08 +01:00
parent efcdaf6f96
commit fc59afa312
1 changed files with 24 additions and 3 deletions

View File

@ -7,12 +7,28 @@ include make-deploy/cron.mk
include make-deploy/kustomize.mk
include make-deploy/helm.mk
.PHONY: self-update create-contexts deploy pre-deploy post-deploy pre-local post-local upload pull start stop restart reload
.PHONY: self-update build test deploy pre-deploy post-deploy pre-local post-local upload pull start stop restart reload
self-update:
@- git submodule update --remote
deploy: upload pre-deploy pre-local pull start post-local post-deploy reload
deploy: build test upload pre-deploy pre-local pull start post-local post-deploy reload
build:
ifneq (,$(wildcard build.sh))
@- echo "\n### running build script"
./build.sh || (echo "### build failed $$?"; exit 1)
else
@- echo "\n### no build script found"
endif
test:
ifneq (,$(wildcard test.sh))
@- echo "\n### running test script"
./test.sh || (echo "### test failed $$?; exit 1)
else
@- echo "\n### no test script found"
endif
pre-deploy:
ifdef DEPLOY_HOSTS
@ -70,7 +86,12 @@ logs: logs-$(DEPLOY_TYPE)
restart: restart-$(DEPLOY_TYPE)
reload:
ifneq (,$(wildcard reload.sh))
@- echo "\n### reloading ..."
@- $(foreach host,$(DEPLOY_HOSTS), \
echo "### reloading service on $(host)"; \
ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); ./reload.sh"; \
)
else
@- echo "\n### no reload script found"
endif