eletrotupi / tcc/ Makefilea135a130af592f91579f04c070b0652d5a6c52c2
1.1 KB | 33 lines Raw
1
# Deployment helpers
2
#
3
# Day-to-day app deploys happen in GitHub Actions
4
# (.github/workflows/deploy.yml) These targets are for the host-config work,
5
# which is done rarely
6

7
SHELL := bash
8
ANSIBLE_DIR := ansible
9
INVENTORY := inventory/hosts.yml
10

11
.PHONY: help deploy-diff deploy-check provision cert deploy-nginx
12

13
help:
14
	@echo "make deploy-diff    # pull live configs and diff them against the repo"
15
	@echo "make deploy-check   # ansible --check --diff (dry run, no changes)"
16
	@echo "make provision      # full host bootstrap (setup + deploy + cert + app)"
17
	@echo "make deploy-nginx   # publish the nginx vhost (deploy.yml)"
18
	@echo "make cert           # install uacme / manage certificates (cert.yml)"
19

20
deploy-diff:
21
	$(ANSIBLE_DIR)/scripts/pull-live-configs.sh
22

23
deploy-check:
24
	cd $(ANSIBLE_DIR) && ansible-playbook -i $(INVENTORY) provision.yml --check --diff
25

26
provision:
27
	cd $(ANSIBLE_DIR) && ansible-playbook -i $(INVENTORY) provision.yml --ask-become-pass
28

29
cert:
30
	cd $(ANSIBLE_DIR) && ansible-playbook -i $(INVENTORY) cert.yml --ask-become-pass
31

32
deploy-nginx:
33
	cd $(ANSIBLE_DIR) && ansible-playbook -i $(INVENTORY) deploy.yml --ask-become-pass