Compare commits
	
		
			2 commits
		
	
	
		
			master
			...
			kubectl_ap
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 435b2f9fcc | |||
| 96fa48f775 | 
					 18 changed files with 113 additions and 295 deletions
				
			
		
							
								
								
									
										2
									
								
								LICENSE
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								LICENSE
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
MIT License
 | 
			
		||||
Copyright (c) 2022 Andreas Neue <an@dnix.de>
 | 
			
		||||
Copyright (c) 2022-25 the make-deploy authors (see CONTRIBUTORS)
 | 
			
		||||
Copyright (c) 2022-23 the make-deploy authors (see CONTRIBUTORS)
 | 
			
		||||
 | 
			
		||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
 | 
			
		||||
this software and associated documentation files (the "Software"), to deal in
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										74
									
								
								Makefile
									
										
									
									
									
								
							
							
						
						
									
										74
									
								
								Makefile
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1,7 +1,4 @@
 | 
			
		|||
DEPLOY_START_DELAY = 0
 | 
			
		||||
DEPLOY_PROJECT_DIR =
 | 
			
		||||
 | 
			
		||||
MANDATORY = DEPLOY_NAME DEPLOY_HOSTS DEPLOY_PATH SSH_USER
 | 
			
		||||
 | 
			
		||||
-include secrets.mk
 | 
			
		||||
include config.mk
 | 
			
		||||
| 
						 | 
				
			
			@ -12,19 +9,20 @@ ifeq ($(DEPLOY_TYPE), copy)
 | 
			
		|||
	DEPLOY_TYPE = simple
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
project_dir = $(DEPLOY_PATH)/$(DEPLOY_NAME)$(DEPLOY_PROJECT_DIR)
 | 
			
		||||
 | 
			
		||||
include make-deploy/$(DEPLOY_TYPE).mk
 | 
			
		||||
 | 
			
		||||
.PHONY: self-update mandatory cleanup prerequisites prepare build test deploy pre-deploy post-deploy pre-local post-local upload pull start stop restart reload notify
 | 
			
		||||
.PHONY: self-update mandatory 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 cleanup prepare build test upload pre-deploy pre-local pull start notify post-local post-deploy reload
 | 
			
		||||
deploy: mandatory prepare build test upload pre-deploy pre-local pull start post-local post-deploy reload
 | 
			
		||||
 | 
			
		||||
mandatory:
 | 
			
		||||
	@- echo "\n### mandatory check"
 | 
			
		||||
ifndef MANDATORY-$(DEPLOY_TYPE)
 | 
			
		||||
	$(error MANDATORY-$(DEPLOY_TYPE) is not defined)
 | 
			
		||||
endif
 | 
			
		||||
	@ $(foreach var,$(MANDATORY), \
 | 
			
		||||
		if test -z "${$(var)}"; then \
 | 
			
		||||
			echo "Missing mandatory variable: $(var)"; \
 | 
			
		||||
| 
						 | 
				
			
			@ -36,22 +34,11 @@ prerequisites:
 | 
			
		|||
	@- echo "\n### prerequisites ..."
 | 
			
		||||
	@- ./prerequisites.sh
 | 
			
		||||
	
 | 
			
		||||
ifdef DEPLOY_CLEANUP
 | 
			
		||||
cleanup:
 | 
			
		||||
	@- echo "\n### cleanup ..."
 | 
			
		||||
	@ $(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		echo "#host: $(host)"; \
 | 
			
		||||
		scp cleanup.sh $(SSH_USER)@$(host):/$(DEPLOY_PATH)/$(DEPLOY_NAME); \
 | 
			
		||||
		if [ -e cleanup.sh ]; then ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); sh cleanup.sh $(host)"; fi; \
 | 
			
		||||
	)
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
prepare:
 | 
			
		||||
	@- echo "\n### preparing ..."
 | 
			
		||||
	@- chmod 600 secrets.mk
 | 
			
		||||
	@ $(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		echo "#host: $(host)"; \
 | 
			
		||||
		ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH); if [ ! -d $(DEPLOY_NAME) ] ; then mkdir $(DEPLOY_NAME); fi"; \
 | 
			
		||||
	@- $(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH); mkdir $(DEPLOY_NAME)"; \
 | 
			
		||||
	)
 | 
			
		||||
	
 | 
			
		||||
build:
 | 
			
		||||
| 
						 | 
				
			
			@ -73,28 +60,23 @@ endif
 | 
			
		|||
pre-deploy:
 | 
			
		||||
ifdef DEPLOY_HOSTS
 | 
			
		||||
	@- echo "\n### running pre-deploy script(s)"
 | 
			
		||||
	@ $(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		echo "#host: $(host)"; \
 | 
			
		||||
		if [ -e pre-deploy.sh ]; then ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); sh pre-deploy.sh $(host)"; fi; \
 | 
			
		||||
		if [ -e pre-deploy_$(host).sh ]; then ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); sh pre-deploy_$(host).sh"; fi; \
 | 
			
		||||
	@- $(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); sh pre-deploy.sh $(host); sh pre-deploy_$(host).sh"; \
 | 
			
		||||
	)
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
post-deploy:
 | 
			
		||||
ifdef DEPLOY_HOSTS
 | 
			
		||||
	@- echo "\n### running post-deploy script(s)"
 | 
			
		||||
	@ $(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		echo "#host: $(host)"; \
 | 
			
		||||
		if [ -e post-deploy.sh ]; then ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); sh post-deploy.sh $(host)"; fi; \
 | 
			
		||||
		if [ -e post-deploy_$(host).sh ]; then ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); sh post-deploy_$(host).sh"; fi; \
 | 
			
		||||
	@- $(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); sh post-deploy.sh $(host); sh post-deploy_$(host).sh"; \
 | 
			
		||||
	)
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
pre-local:
 | 
			
		||||
ifneq (,$(wildcard pre-local.sh))
 | 
			
		||||
	@- echo "\n### running pre-local script"
 | 
			
		||||
	@ $(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		echo "#host: $(host)"; \
 | 
			
		||||
	@- $(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		./pre-local.sh $(host); \
 | 
			
		||||
	)
 | 
			
		||||
else
 | 
			
		||||
| 
						 | 
				
			
			@ -104,8 +86,7 @@ endif
 | 
			
		|||
post-local:
 | 
			
		||||
ifneq (,$(wildcard post-local.sh))
 | 
			
		||||
	@- echo "\n### running post-local script"
 | 
			
		||||
	@ $(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		echo "#host: $(host)"; \
 | 
			
		||||
	@- $(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		./post-local.sh $(host); \
 | 
			
		||||
	)
 | 
			
		||||
else
 | 
			
		||||
| 
						 | 
				
			
			@ -115,17 +96,10 @@ endif
 | 
			
		|||
upload:
 | 
			
		||||
ifdef DEPLOY_HOSTS
 | 
			
		||||
	@- echo "\n### uploading files"
 | 
			
		||||
	@$(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		echo "#host: $(host)"; \
 | 
			
		||||
		ssh $(SSH_USER)@$(host) "if [ ! -d $(DEPLOY_PATH)/$(DEPLOY_NAME) ]; then mkdir -p $(DEPLOY_PATH)/$(DEPLOY_NAME); fi"; \
 | 
			
		||||
		if [ -r .rsync ] ; then rsync_xtra=`cat .rsync`; fi; \
 | 
			
		||||
		if [ -r .rsync_$(host) ] ; then rsync_xtra_host=`cat .rsync_$(host)`; fi; \
 | 
			
		||||
		param="-ravv"; \
 | 
			
		||||
		param="$$param $$rsync_xtra"; \
 | 
			
		||||
		param="$$param $$rsync_xtra_host"; \
 | 
			
		||||
		param="$$param --exclude '*~' --exclude '.git*' --exclude '*.swp' . $(SSH_USER)@$(host):$(DEPLOY_PATH)/$(DEPLOY_NAME)"; \
 | 
			
		||||
		eval rsync $$param; \
 | 
			
		||||
		ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); if [ -e .env ]; then chmod o-r .env ; fi; if [ -e secrets.mk ]; then chmod o-r secrets.mk; fi; if [ -e secrets.yaml ]; then chmod o-r secrets.yaml; fi"; \
 | 
			
		||||
	@- $(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		ssh $(SSH_USER)@$(host) "mkdir -p $(DEPLOY_PATH)/$(DEPLOY_NAME)"; \
 | 
			
		||||
		rsync -rav --exclude '*~' --exclude '.git*' --exclude '*.swp' . $(SSH_USER)@$(host):$(DEPLOY_PATH)/$(DEPLOY_NAME); \
 | 
			
		||||
		ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME) && chmod o-r .env secrets*"; \
 | 
			
		||||
	)
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -135,16 +109,6 @@ start: start-$(DEPLOY_TYPE)
 | 
			
		|||
 | 
			
		||||
stop: stop-$(DEPLOY_TYPE)
 | 
			
		||||
	
 | 
			
		||||
notify:
 | 
			
		||||
ifdef DEPLOY_NOTIFY_HOSTS
 | 
			
		||||
ifdef DEPLOY_NOTIFY_MAIL
 | 
			
		||||
ifdef DEPLOY_NOTIFY_MSG
 | 
			
		||||
	@- echo "\n### notify"
 | 
			
		||||
	@- echo "$$DEPLOY_NOTIFY_MSG :: Please deploy manually on following hosts: $$DEPLOY_NOTIFY_HOSTS" | mail -s "make-deploy notification" $(DEPLOY_MAIL)
 | 
			
		||||
endif
 | 
			
		||||
endif
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
logs: logs-$(DEPLOY_TYPE)
 | 
			
		||||
 | 
			
		||||
restart: restart-$(DEPLOY_TYPE)
 | 
			
		||||
| 
						 | 
				
			
			@ -152,9 +116,9 @@ restart: restart-$(DEPLOY_TYPE)
 | 
			
		|||
reload:
 | 
			
		||||
ifneq (,$(wildcard reload.sh))
 | 
			
		||||
	@- echo "\n### reloading ..."
 | 
			
		||||
	@ $(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
	@- $(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		echo "### reloading service on $(host)"; \
 | 
			
		||||
		if [ -e reload.sh ]; then ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); ./reload.sh"; fi; \
 | 
			
		||||
		ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); ./reload.sh"; \
 | 
			
		||||
	)
 | 
			
		||||
else
 | 
			
		||||
	@- echo "\n### no reload script found"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										17
									
								
								README.md
									
										
									
									
									
								
							
							
						
						
									
										17
									
								
								README.md
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -2,13 +2,15 @@
 | 
			
		|||
 | 
			
		||||
A simple Makefile based deployment system.
 | 
			
		||||
 | 
			
		||||
**make-deploy** was initially hosted at https://git.dnix.de/an/make-deploy. Since it has become heavily used at chefkoch.de for system deployments, and lots of code is committed there, we moved the repo to https://git.chefkoch.net/pub/make-deploy. A mirror still exists at https://git.dnix.de/mirror/make-deploy.
 | 
			
		||||
 | 
			
		||||
**make-deploy** is licensed under the terms of the MIT-License. See [LICENSE](LICENSE) for info.
 | 
			
		||||
 | 
			
		||||
## Installation
 | 
			
		||||
 | 
			
		||||
1. Clone **make-deploy** as a submodule into your repository:
 | 
			
		||||
 | 
			
		||||
    $ git submodule add https://git.dnix.de/dnix/make-deploy
 | 
			
		||||
    $ git submodule add https://git.chefkoch.net/pub/make-deploy
 | 
			
		||||
    
 | 
			
		||||
2. Create a symlink to the Makefile:
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -22,7 +24,6 @@ Example `config.mk`:
 | 
			
		|||
	DEPLOY_PATH = /srv
 | 
			
		||||
	DEPLOY_TYPE = compose
 | 
			
		||||
	DEPLOY_HOSTS = server01.example.com server02.example.com
 | 
			
		||||
	DEPLOY_SUBPATH = my-sub-path
 | 
			
		||||
 | 
			
		||||
	DOCKER_IMAGE = dr.example.com/my-project:latest
 | 
			
		||||
	DOCKER_LOGIN = 1
 | 
			
		||||
| 
						 | 
				
			
			@ -35,8 +36,6 @@ Example `secrets.mk`:
 | 
			
		|||
    DOCKER_USER = root
 | 
			
		||||
    DOCKER_PASS = secret1234
 | 
			
		||||
 | 
			
		||||
`DEPLOY_SUBPATH` is used to define a location for `DEPLOY_TYPE` = compose that states where the docker-compose.yml is placed at. If that variable is undefined, it is expected to be in projects root.
 | 
			
		||||
 | 
			
		||||
By setting `DEPLOY_CONFIG_OVERRIDE`, an alternative config can be loaded to override existing configuration settings. This is useful in script calling make deploy or in a `.gitlab-ci.yml` in order to control settings for different targets.
 | 
			
		||||
 | 
			
		||||
## Usage
 | 
			
		||||
| 
						 | 
				
			
			@ -55,8 +54,6 @@ 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.
 | 
			
		||||
| 
						 | 
				
			
			@ -134,11 +131,3 @@ systemd. (TBD)
 | 
			
		|||
##### apt
 | 
			
		||||
 | 
			
		||||
APT deployment on debian-like distributions.
 | 
			
		||||
 | 
			
		||||
##### tf
 | 
			
		||||
 | 
			
		||||
Deploy via Terraform. Config is mostly done with terraform.
 | 
			
		||||
 | 
			
		||||
`TF_FLAGS`: What you think.
 | 
			
		||||
 | 
			
		||||
`TF_TARGET`: Limits deployment to `TF_TARGET`.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										11
									
								
								apt.mk
									
										
									
									
									
								
							
							
						
						
									
										11
									
								
								apt.mk
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1,15 +1,12 @@
 | 
			
		|||
MANDATORY = $(shell printenv MANDATORY) APT_PACKAGES
 | 
			
		||||
MANDATORY-apt = APT_PACKAGES
 | 
			
		||||
 | 
			
		||||
pull-apt:
 | 
			
		||||
	# nop
 | 
			
		||||
 | 
			
		||||
start-apt:
 | 
			
		||||
	@- echo "\n### start"
 | 
			
		||||
	@ $(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		echo "#host: $(host)"; \
 | 
			
		||||
		set -e; \
 | 
			
		||||
		ssh $(SSH_USER)@$(host) "sudo apt install -y $(APT_PACKAGES)"; \
 | 
			
		||||
		if [ -e start.sh ]; then ssh $(SSH_USER)@$(host) "sh start.sh"; fi; \
 | 
			
		||||
	@- $(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		echo "$(host)"; \
 | 
			
		||||
		ssh $(SSH_USER)@$(host) "sudo apt install -y $(APT_PACKAGES); sh start.sh"; \
 | 
			
		||||
		sleep $(DEPLOY_START_DELAY); \
 | 
			
		||||
		set +e; \
 | 
			
		||||
	)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,52 +1,39 @@
 | 
			
		|||
MANDATORY = $(shell printenv MANDATORY) SSH_USER DEPLOY_COMPOSE_FILE DEPLOY_COMPOSE_PROJECT
 | 
			
		||||
 | 
			
		||||
ifndef DOCKER_LOGIN
 | 
			
		||||
DOCKER_LOGIN = 0
 | 
			
		||||
endif
 | 
			
		||||
MANDATORY-compose-file = DEPLOY_HOSTS DEPLOY_TYPE TAG DEPLOY_COMPOSE_FILE DEPLOY_COMPOSE_PROJECT
 | 
			
		||||
 | 
			
		||||
pull-compose-file:
 | 
			
		||||
	@ echo "\n### pulling image(s)"
 | 
			
		||||
	@$(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		echo "#host: $(host)"; \
 | 
			
		||||
		if test "$(DOCKER_LOGIN)" -eq 1 ; \
 | 
			
		||||
	@- echo "\n### pulling image(s)"
 | 
			
		||||
	@- $(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		echo "$(host)"; \
 | 
			
		||||
		if test $(DOCKER_LOGIN) -eq 1 ; \
 | 
			
		||||
		then \
 | 
			
		||||
			echo "\n#### perform docker login with user $(DOCKER_USER) on $(DOCKER_REGISTRY)"; \
 | 
			
		||||
			ssh $(SSH_USER)@$(host) "echo $(DOCKER_PASS) | docker login -u $(DOCKER_USER) --password-stdin $(DOCKER_REGISTRY)"; \
 | 
			
		||||
			echo "\n#### perfom docker login with user $(DOCKER_USER) on $(DOCKER_REGISTRY)"; \
 | 
			
		||||
			ssh $(SSH_USER)@$(host) "docker login -u $(DOCKER_USER) -p $(DOCKER_PASS) $(DOCKER_REGISTRY)"; \
 | 
			
		||||
		fi; \
 | 
			
		||||
		if test -n "$(DOCKER_IMAGE)" ; \
 | 
			
		||||
		then \
 | 
			
		||||
		ssh $(SSH_USER)@$(host) "docker pull $(DOCKER_IMAGE)"; \
 | 
			
		||||
		fi; \
 | 
			
		||||
	)
 | 
			
		||||
 | 
			
		||||
start-compose-file:
 | 
			
		||||
	@ echo "\n### starting service(s)"
 | 
			
		||||
	@$(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		set -e; \
 | 
			
		||||
		echo "#host: $(host)"; \
 | 
			
		||||
	@- echo "\n### starting service(s)"
 | 
			
		||||
	@- $(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		echo "$(host)"; \
 | 
			
		||||
		ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); docker-compose -f $(DEPLOY_COMPOSE_FILE) -p $(DEPLOY_COMPOSE_PROJECT) up -d"; \
 | 
			
		||||
		sleep $(DEPLOY_START_DELAY); \
 | 
			
		||||
		set +e; \
 | 
			
		||||
	)
 | 
			
		||||
 | 
			
		||||
stop-compose-file:
 | 
			
		||||
	@echo "\n### stopping service(s)"
 | 
			
		||||
	@$(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		set -e; \
 | 
			
		||||
		echo "#host: $(host)"; \
 | 
			
		||||
	@- echo "\n### stopping service(s)"
 | 
			
		||||
	@- $(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		echo "$(host)"; \
 | 
			
		||||
		ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); docker-compose -f $(DEPLOY_COMPOSE_FILE) -p $(DEPLOY_COMPOSE_PROJECT) down"; \
 | 
			
		||||
		set +e; \
 | 
			
		||||
	)
 | 
			
		||||
		
 | 
			
		||||
logs-compose-file:
 | 
			
		||||
	@ echo "\n### logs"
 | 
			
		||||
	@ ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); docker-compose -f $(DEPLOY_COMPOSE_FILE) -p $(DEPLOY_COMPOSE_PROJECT) logs -f $(service)"
 | 
			
		||||
	@- echo "\n### logs"
 | 
			
		||||
	@- ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); docker-compose -f $(DEPLOY_COMPOSE_FILE) -p $(DEPLOY_COMPOSE_PROJECT) logs -f $(service)"
 | 
			
		||||
	
 | 
			
		||||
restart-compose-file:
 | 
			
		||||
	@$(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		set -e; \
 | 
			
		||||
		echo "#host: $(host)"; \
 | 
			
		||||
	@- $(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		echo "$(host)"; \
 | 
			
		||||
		ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); docker-compose -f $(DEPLOY_COMPOSE_FILE) -p $(DEPLOY_COMPOSE_PROJECT) restart"; \
 | 
			
		||||
		sleep $(DEPLOY_START_DELAY); \
 | 
			
		||||
		set +e; \
 | 
			
		||||
	)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										62
									
								
								compose.mk
									
										
									
									
									
								
							
							
						
						
									
										62
									
								
								compose.mk
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1,55 +1,39 @@
 | 
			
		|||
ifdef DOCKER_LOGIN
 | 
			
		||||
MANDATORY = $(shell printenv MANDATORY) DOCKER_USER DOCKER_PASS DOCKER_REGISTRY
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
ifndef DOCKER_LOGIN
 | 
			
		||||
DOCKER_LOGIN = 0
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
ifndef COMPOSE_CMD
 | 
			
		||||
COMPOSE_CMD = 'docker-compose'
 | 
			
		||||
endif
 | 
			
		||||
MANDATORY-compose = DEPLOY_HOSTS DEPLOY_TYPE TAG
 | 
			
		||||
 | 
			
		||||
pull-compose:
 | 
			
		||||
	@echo "\n### pulling image(s)"
 | 
			
		||||
	@$(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		echo "#host: $(host)"; \
 | 
			
		||||
		if test "$(DOCKER_LOGIN)" -eq 1 ; \
 | 
			
		||||
	@- echo "\n### pulling image(s)"
 | 
			
		||||
	@- $(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		echo "$(host)"; \
 | 
			
		||||
		if test $(DOCKER_LOGIN) -eq 1 ; \
 | 
			
		||||
		then \
 | 
			
		||||
			echo "\n#### perform docker login with user $(DOCKER_USER) on $(DOCKER_REGISTRY)"; \
 | 
			
		||||
			ssh $(SSH_USER)@$(host) "echo $(DOCKER_PASS) | docker login -u $(DOCKER_USER) --password-stdin $(DOCKER_REGISTRY)"; \
 | 
			
		||||
			echo "\n#### perfom docker login with user $(DOCKER_USER) on $(DOCKER_REGISTRY)"; \
 | 
			
		||||
			ssh $(SSH_USER)@$(host) "docker login -u $(DOCKER_USER) -p $(DOCKER_PASS) $(DOCKER_REGISTRY)"; \
 | 
			
		||||
		fi; \
 | 
			
		||||
		if test -n "$(DOCKER_IMAGE)" ; \
 | 
			
		||||
		then \
 | 
			
		||||
		ssh $(SSH_USER)@$(host) "docker pull $(DOCKER_IMAGE)"; \
 | 
			
		||||
		fi; \
 | 
			
		||||
	)
 | 
			
		||||
 | 
			
		||||
start-compose:
 | 
			
		||||
	@echo "\n### starting service(s)"
 | 
			
		||||
	@$(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		set -e; \
 | 
			
		||||
		echo "#host: $(host)"; \
 | 
			
		||||
		ssh $(SSH_USER)@$(host) "cd $(project_dir); $(COMPOSE_CMD) up -d"; \
 | 
			
		||||
	@- echo "\n### starting service(s)"
 | 
			
		||||
	@- $(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		echo "$(host)"; \
 | 
			
		||||
		ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); docker-compose up -d"; \
 | 
			
		||||
		sleep $(DEPLOY_START_DELAY); \
 | 
			
		||||
		set +e; \
 | 
			
		||||
	)
 | 
			
		||||
 | 
			
		||||
stop-compose:
 | 
			
		||||
	@- echo "\n### stopping service(s)"
 | 
			
		||||
	@- $(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		echo "$(host)"; \
 | 
			
		||||
		ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); docker-compose down"; \
 | 
			
		||||
	)
 | 
			
		||||
		
 | 
			
		||||
logs-compose:
 | 
			
		||||
	@echo "\n### logs"
 | 
			
		||||
	@$(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		set -e; \
 | 
			
		||||
		echo "#host: $(host)"; \
 | 
			
		||||
		ssh $(SSH_USER)@$(host) "cd $(project_dir); $(COMPOSE_CMD) logs -f $(service)"; \
 | 
			
		||||
		set +e; \
 | 
			
		||||
	)
 | 
			
		||||
	@- echo "\n### logs"
 | 
			
		||||
	@- ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); docker-compose logs -f $(service)"
 | 
			
		||||
	
 | 
			
		||||
restart-compose:
 | 
			
		||||
	@echo "\n### restarting service(s)"
 | 
			
		||||
	@$(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		set -e; \
 | 
			
		||||
		echo "#host: $(host)"; \
 | 
			
		||||
		ssh $(SSH_USER)@$(host) "cd $(project_dir); $(COMPOSE_CMD) restart"; \
 | 
			
		||||
	@- $(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		echo "$(host)"; \
 | 
			
		||||
		ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); docker-compose restart"; \
 | 
			
		||||
		sleep $(DEPLOY_START_DELAY); \
 | 
			
		||||
		set +e; \
 | 
			
		||||
	)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										6
									
								
								cron.mk
									
										
									
									
									
								
							
							
						
						
									
										6
									
								
								cron.mk
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1,22 +1,18 @@
 | 
			
		|||
MANDATORY = $(shell printenv MANDATORY) CRON_USER 
 | 
			
		||||
MANDATORY-cron = true
 | 
			
		||||
 | 
			
		||||
start-cron:
 | 
			
		||||
	@- echo "\n### starting..."
 | 
			
		||||
	@- $(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		echo "$(host)"; \
 | 
			
		||||
		set -e; \
 | 
			
		||||
		ssh $(SSH_USER)@$(host) "sudo -u $(CRON_USER) sh -c 'crontab -l | sed \"/^#make-deploy-cron:$(DEPLOY_NAME)/,+1 d\" | { cat; echo \"#make-deploy-cron:$(DEPLOY_NAME)\"; cat \"$(DEPLOY_PATH)/$(DEPLOY_NAME)/crontab\"; } | crontab -'"; \
 | 
			
		||||
		sleep $(DEPLOY_START_DELAY); \
 | 
			
		||||
		set +e; \
 | 
			
		||||
	)
 | 
			
		||||
	
 | 
			
		||||
stop-cron:
 | 
			
		||||
	@- echo "\n### stopping ..."
 | 
			
		||||
	@- $(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		echo "$(host)"; \
 | 
			
		||||
		set -e; \
 | 
			
		||||
		ssh $(SSH_USER)@$(host) "sudo -u $(CRON_USER) sh -c 'crontab -l | sed \"/^#make-deploy-cron:$(DEPLOY_NAME)/,+1 d\" | crontab -'"; \
 | 
			
		||||
		set +e; \
 | 
			
		||||
	)
 | 
			
		||||
 | 
			
		||||
pull-cron:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										30
									
								
								helm.mk
									
										
									
									
									
								
							
							
						
						
									
										30
									
								
								helm.mk
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
MANDATORY = $(shell printenv MANDATORY) K8S_CONTEXT HELM_CHART_NAME HELM_CHART_PATH HELM_VALUES_FILE K8S_NAMESPACE
 | 
			
		||||
MANDATORY-helm = K8S_CONTEXT HELM_CHART_NAME HELM_CHART_PATH HELM_VALUES_FILE NAMESPACE
 | 
			
		||||
# helm
 | 
			
		||||
#
 | 
			
		||||
# deploys helm charts on k8s via helm
 | 
			
		||||
| 
						 | 
				
			
			@ -14,43 +14,21 @@ ifdef TEST_MODE
 | 
			
		|||
endif
 | 
			
		||||
 | 
			
		||||
ifdef NAMESPACE
 | 
			
		||||
	@ $(eval K8S_NAMESPACE = $(NAMESPACE))
 | 
			
		||||
	K8S_NAMESPACE = $(NAMESPACE)
 | 
			
		||||
endif
 | 
			
		||||
	
 | 
			
		||||
ifdef HELM_REPO_URL
 | 
			
		||||
	@- echo "Helm Repo: $(HELM_REPO_URL)"
 | 
			
		||||
	@ helm repo add $(HELM_CHART_NAME) $(HELM_REPO_URL)
 | 
			
		||||
	@- helm repo update $(HELM_CHART_NAME)
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
ifdef DEBUG_MODE
 | 
			
		||||
	@- echo "\n### deploying helm chart with --debug flag"
 | 
			
		||||
	@- echo "-- DEBUG DEPLOYMENT --------------------"
 | 
			
		||||
	@- echo " "
 | 
			
		||||
	@- echo "Namespace: $(K8S_NAMESPACE)"
 | 
			
		||||
	@- echo "Helm Chart: $(HELM_CHART_PATH)"
 | 
			
		||||
	@- echo "Helm Version (use latest if empty): $(HELM_CHART_VERSION)"
 | 
			
		||||
	@- echo "Values File: $(HELM_VALUES_FILE)"
 | 
			
		||||
	@- echo " "
 | 
			
		||||
	@- echo "----------------------------------"
 | 
			
		||||
 | 
			
		||||
	@ envsubst < $(HELM_VALUES_FILE) | helm upgrade $(HELM_CHART_NAME) $(HELM_CHART_PATH) -n $(K8S_NAMESPACE) --install --debug --wait --values - --version "$(HELM_CHART_VERSION)"
 | 
			
		||||
 | 
			
		||||
else
 | 
			
		||||
	
 | 
			
		||||
	@- echo "\n### deploying helm chart"
 | 
			
		||||
	@- echo "-- DEPLOYMENT --------------------"
 | 
			
		||||
	@- echo " "
 | 
			
		||||
	@- echo "Namespace: $(K8S_NAMESPACE)"
 | 
			
		||||
	@- echo "Helm Chart: $(HELM_CHART_PATH)"
 | 
			
		||||
	@- echo "Helm Version (use latest if empty): $(HELM_CHART_VERSION)"
 | 
			
		||||
	@- echo "Values File: $(HELM_VALUES_FILE)"
 | 
			
		||||
	@- echo " "
 | 
			
		||||
	@- echo "----------------------------------"
 | 
			
		||||
 | 
			
		||||
	@ envsubst < $(HELM_VALUES_FILE) | helm upgrade $(HELM_CHART_NAME) $(HELM_CHART_PATH) -n $(K8S_NAMESPACE) --install --wait --values - --version "$(HELM_CHART_VERSION)"
 | 
			
		||||
	@ envsubst < $(HELM_VALUES_FILE) | helm upgrade $(HELM_CHART_NAME) $(HELM_CHART_PATH) -n $(K8S_NAMESPACE) --install --wait --values -
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
pull-helm:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										38
									
								
								k8s.mk
									
										
									
									
									
								
							
							
						
						
									
										38
									
								
								k8s.mk
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -2,21 +2,35 @@
 | 
			
		|||
#
 | 
			
		||||
# deploys k8s
 | 
			
		||||
 | 
			
		||||
MANDATORY = $(shell printenv MANDATORY) K8S_CONTEXT
 | 
			
		||||
K8S_MANIFEST_FILENAME ?= kubernetes.yaml
 | 
			
		||||
ifneq ("$(wildcard secrets.yaml)","")
 | 
			
		||||
  SECRETS="secrets.yaml"
 | 
			
		||||
else
 | 
			
		||||
  SECRETS=""
 | 
			
		||||
endif
 | 
			
		||||
MANDATORY-k8s = K8S_CONTEXT
 | 
			
		||||
 | 
			
		||||
start-k8s: SHELL:=/bin/bash
 | 
			
		||||
start-k8s:
 | 
			
		||||
	@- echo "\n### starting deployment with k8s"
 | 
			
		||||
	@- echo "\n### setting kubernetes context to $(K8S_CONTEXT)"
 | 
			
		||||
	@ kubectl config use-context $(K8S_CONTEXT)
 | 
			
		||||
	@- echo "### starting deployment with k8s"
 | 
			
		||||
	@- echo "### setting kubernetes context to $(K8S_CONTEXT)"
 | 
			
		||||
	#@ kubectl config use-context $(K8S_CONTEXT)
 | 
			
		||||
 | 
			
		||||
	@- echo "\n### run kubectl apply -f $(K8S_MANIFEST_FILENAME) and if available secrets file $(SECRETS)"
 | 
			
		||||
	@ cat $(K8S_MANIFEST_FILENAME) $(SECRETS) | envsubst | kubectl apply $(K8S_ADDITIONAL_PARAMS) -f -
 | 
			
		||||
	@- echo "### run kubectl apply -f kubernetes.yaml and secrets.yaml"
 | 
			
		||||
	@- cat kubernetes.yaml secrets.yaml >_manifest.yaml
 | 
			
		||||
 | 
			
		||||
ifdef K8S_MANIFESTS
 | 
			
		||||
	@- echo "\n%%%DEBUG1"
 | 
			
		||||
	@- echo $(K8S_MANIFESTS)
 | 
			
		||||
	@- for file in $(K8S_MANIFESTS); do \
 | 
			
		||||
		if [[ $$file == http* ]] ; \
 | 
			
		||||
		then \
 | 
			
		||||
			curl -o _tmpfile.yaml $$file; \
 | 
			
		||||
		else \
 | 
			
		||||
			cp $$file _tmpfile.yaml; \
 | 
			
		||||
		fi; \
 | 
			
		||||
		cat _tmpfile.yaml >>_manifest.yaml; \
 | 
			
		||||
		rm _tmpfile.yaml; \
 | 
			
		||||
	done
 | 
			
		||||
endif
 | 
			
		||||
	@- echo "\n%%%DEBUG22"
 | 
			
		||||
 | 
			
		||||
	@ cat _manifest.yaml | envsubst | kubectl apply -f -
 | 
			
		||||
	@- rm _manifest.yaml
 | 
			
		||||
 | 
			
		||||
pull-k8s:
 | 
			
		||||
# nop
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
MANDATORY = $(shell printenv MANDATORY) K8S_CONTEXT KUSTOMIZE_FOLDER NAMESPACE
 | 
			
		||||
MANDATORY-kustomize = K8S_CONTEXT KUSTOMIZE_FOLDER NAMESPACE
 | 
			
		||||
# kustomize
 | 
			
		||||
#
 | 
			
		||||
# this uses kustomize to install stuff on k8s
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										15
									
								
								simple.mk
									
										
									
									
									
								
							
							
						
						
									
										15
									
								
								simple.mk
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1,21 +1,18 @@
 | 
			
		|||
# simple 
 | 
			
		||||
MANDATORY-copy = DEPLOY_TYPE DEPLOY_HOSTS SSH_USER DEPLOY_PATH DEPLOY_NAME
 | 
			
		||||
MANDATORY-simple = $(MANDATORY-copy)
 | 
			
		||||
 | 
			
		||||
# copy
 | 
			
		||||
#
 | 
			
		||||
# this just rsyncs the stuff to the remote server(s) and runs
 | 
			
		||||
# build.sh, pre-/post-deploy, pre-/post-local, start.sh, etc.
 | 
			
		||||
 | 
			
		||||
ifndef DEPLOY_START_DELAY
 | 
			
		||||
DEPLOY_START_DELAY = 0
 | 
			
		||||
endif
 | 
			
		||||
 | 
			
		||||
pull-simple:
 | 
			
		||||
	# nop
 | 
			
		||||
	
 | 
			
		||||
start-simple:
 | 
			
		||||
	@- echo "\n### start"
 | 
			
		||||
	@- $(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		echo "#host: $(host)"; \
 | 
			
		||||
		set -e; \
 | 
			
		||||
		if [ -e start.sh ] ; then ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); sh start.sh"; fi; \
 | 
			
		||||
		echo "$(host)"; \
 | 
			
		||||
		ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); sh start.sh"; \
 | 
			
		||||
		sleep $(DEPLOY_START_DELAY); \
 | 
			
		||||
		set +e; \
 | 
			
		||||
	)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										4
									
								
								swarm.mk
									
										
									
									
									
								
							
							
						
						
									
										4
									
								
								swarm.mk
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1,12 +1,12 @@
 | 
			
		|||
MANDATORY-swarm = DEPLOY_HOSTS DEPLOY_TYPE TAG
 | 
			
		||||
 | 
			
		||||
pull-swarm:
 | 
			
		||||
 | 
			
		||||
start-swarm:
 | 
			
		||||
	@- echo "\n### starting service(s)"
 | 
			
		||||
	@- $(foreach host,$(DEPLOY_HOSTS), \
 | 
			
		||||
		echo "$(host)"; \
 | 
			
		||||
		set -e; \
 | 
			
		||||
		ssh $(SSH_USER)@$(host) "cd $(DEPLOY_PATH)/$(DEPLOY_NAME); docker stack deploy -c stack.yml $(DEPLOY_NAME)"; \
 | 
			
		||||
		set +e; \
 | 
			
		||||
	)
 | 
			
		||||
 | 
			
		||||
stop-swarm:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										50
									
								
								test.sh
									
										
									
									
									
								
							
							
						
						
									
										50
									
								
								test.sh
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1,50 +0,0 @@
 | 
			
		|||
#!/bin/bash
 | 
			
		||||
 | 
			
		||||
set -e
 | 
			
		||||
 | 
			
		||||
DIR=$(mktemp -d)
 | 
			
		||||
TESTS=$DIR/make-deploy/testing
 | 
			
		||||
 | 
			
		||||
function prepdir() {
 | 
			
		||||
  mkdir $DIR/make-deploy
 | 
			
		||||
  cp -r * $DIR/make-deploy
 | 
			
		||||
  cd $DIR
 | 
			
		||||
  ln -s make-deploy/Makefile
 | 
			
		||||
  touch secrets.mk
 | 
			
		||||
  echo "::::::::: testing directory root: $DIR"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function cleandir(){
 | 
			
		||||
  rm -fr $DIR
 | 
			
		||||
  echo "::::::::: cleanup done"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function test_with_minimal_vars_apt(){
 | 
			
		||||
  echo "::::::::: $FUNCNAME ::::::::::::"
 | 
			
		||||
  cp $TESTS/apt_config.mk config.mk
 | 
			
		||||
  make deploy
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function test_with_minimal_vars_compose(){
 | 
			
		||||
  echo "::::::::: $FUNCNAME ::::::::::::"
 | 
			
		||||
  cp $TESTS/compose_config.mk config.mk
 | 
			
		||||
  cp $TESTS/docker-compose.yml .
 | 
			
		||||
  make deploy
 | 
			
		||||
  rm -f docker-compose.yml
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function test_with_minimal_vars_compose_file(){
 | 
			
		||||
  echo "::::::::: $FUNCNAME ::::::::::::"
 | 
			
		||||
  cp $TESTS/compose_file_config.mk config.mk
 | 
			
		||||
  cp $TESTS/docker-compose.yml .
 | 
			
		||||
  make deploy
 | 
			
		||||
  rm -f docker-compose.yml
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
prepdir
 | 
			
		||||
 | 
			
		||||
test_with_minimal_vars_apt
 | 
			
		||||
test_with_minimal_vars_compose
 | 
			
		||||
test_with_minimal_vars_compose_file
 | 
			
		||||
 | 
			
		||||
cleandir
 | 
			
		||||
| 
						 | 
				
			
			@ -1,6 +0,0 @@
 | 
			
		|||
DEPLOY_NAME = make-deploy-test-apt
 | 
			
		||||
DEPLOY_PATH = /tmp
 | 
			
		||||
DEPLOY_HOSTS = localhost
 | 
			
		||||
DEPLOY_TYPE = apt
 | 
			
		||||
SSH_USER = $(USER)
 | 
			
		||||
APT_PACKAGES = curl
 | 
			
		||||
| 
						 | 
				
			
			@ -1,5 +0,0 @@
 | 
			
		|||
DEPLOY_NAME = make-deploy-test-compose
 | 
			
		||||
DEPLOY_PATH = /tmp
 | 
			
		||||
DEPLOY_HOSTS = localhost
 | 
			
		||||
DEPLOY_TYPE = compose
 | 
			
		||||
SSH_USER = $(USER)
 | 
			
		||||
| 
						 | 
				
			
			@ -1,7 +0,0 @@
 | 
			
		|||
DEPLOY_NAME = make-deploy-test-compose-file
 | 
			
		||||
DEPLOY_PATH = /tmp
 | 
			
		||||
DEPLOY_HOSTS = localhost
 | 
			
		||||
DEPLOY_TYPE = compose-file
 | 
			
		||||
SSH_USER = $(USER)
 | 
			
		||||
DEPLOY_COMPOSE_PROJECT = make-deploy-test-compose-file
 | 
			
		||||
DEPLOY_COMPOSE_FILE = docker-compose.yml
 | 
			
		||||
| 
						 | 
				
			
			@ -1,4 +0,0 @@
 | 
			
		|||
services:
 | 
			
		||||
  curl:
 | 
			
		||||
    image: "alpine/curl"
 | 
			
		||||
    command: -s -o /dev/null https://www.test.de
 | 
			
		||||
							
								
								
									
										16
									
								
								tf.mk
									
										
									
									
									
								
							
							
						
						
									
										16
									
								
								tf.mk
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1,16 +0,0 @@
 | 
			
		|||
MANDATORY = $(shell printenv MANDATORY) TF_FLAGS
 | 
			
		||||
 | 
			
		||||
# tf
 | 
			
		||||
#
 | 
			
		||||
# deploys via tf apply
 | 
			
		||||
#
 | 
			
		||||
start-tf:
 | 
			
		||||
ifdef TF_TARGET
 | 
			
		||||
	terraform apply $(TF_FLAGS) -t $(TF_TARGET)
 | 
			
		||||
else
 | 
			
		||||
	terraform apply $(TF_FLAGS)
 | 
			
		||||
endif
 | 
			
		||||
	
 | 
			
		||||
	
 | 
			
		||||
pull-tf:
 | 
			
		||||
# nop
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue