diff --git a/Makefile b/Makefile index c9ba6fc..e5e2871 100644 --- a/Makefile +++ b/Makefile @@ -11,12 +11,12 @@ endif include make-deploy/$(DEPLOY_TYPE).mk -.PHONY: self-update mandatory prerequisites prepare build test deploy pre-deploy post-deploy pre-local post-local upload pull start stop restart reload +.PHONY: self-update mandatory cleanup prerequisites prepare build test deploy pre-deploy post-deploy pre-local post-local upload pull start stop restart reload self-update: @- git submodule update --remote -deploy: mandatory prepare build test upload pre-deploy pre-local pull start post-local post-deploy reload +deploy: mandatory cleanup prepare build test upload pre-deploy pre-local pull start post-local post-deploy reload mandatory: @- echo "\n### mandatory check" @@ -33,6 +33,12 @@ endif prerequisites: @- echo "\n### prerequisites ..." @- ./prerequisites.sh + +cleanup: + @- echo "\n### cleanup ..." + @- $(foreach host,$(DEPLOY_HOSTS), \ + ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); sh cleanup.sh $(host)"; \ + ) prepare: @- echo "\n### preparing ..." diff --git a/README.md b/README.md index 183d0ab..ba41aee 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,8 @@ Relying only on GNU Make and simple CLI tools makes deployments robust and still `mandatory`: Checks if all needed variables are set in config.mk. +`cleanup`: Runs `cleanup.sh` on each remote target, meant to be used to wipe contents of prior installations. + `prepare`: Creates needed directory for the deployment on the target system, sets secure file permissions for `secrets.mk`. `build`: Calls `build.sh` locally. This is for building purposts, e.g. docker build and push.