From fc59afa3123688997e5716dbce7da6e06afeb9fc Mon Sep 17 00:00:00 2001 From: Andreas Neue Date: Fri, 25 Nov 2022 10:16:08 +0100 Subject: [PATCH] add build and test targets --- Makefile | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index dc1b4aa..bf5a05e 100644 --- a/Makefile +++ b/Makefile @@ -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