-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
42 lines (36 loc) · 1.56 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
.PHONY: deploy
SHELL := /bin/bash
all:
@echo -e "Make commands:"
@echo -e "\tinit \t\t -- Create data directories & files"
@echo -e "\tstack \t\t -- Generate compose stacks in deploy directory"
@echo -e "\tpull \t\t -- Pull docker images"
@echo -e "\ttraefik \t -- Deploy traefik stack (app role)"
@echo -e "\tworkspace \t -- Deploy workspace stack (dev role)"
init:
mkdir -p /work /root/data/{db,traefik/config,portainer/{data,config}}
touch /root/data/traefik/{traefik.yml,acme.json}
chmod 600 /root/data/traefik/acme.json
stack:
source swarm/lib/helpers.sh && source swarm/lib/doctl.sh && XDG_CONFIG_HOME=/root/.config verify_doctl
esh stack-traefik.yml > deploy/stack-traefik.yml
esh stack-hello-world.yml > deploy/stack-hello-world.yml
esh stack-portainer-agent.yml > deploy/stack-portainer-agent.yml
esh stack-portainer.yml > deploy/stack-portainer.yml
esh stack-db.yml > deploy/stack-db.yml
esh stack-workspace.yml > deploy/stack-workspace.yml
pull:
docker pull traefik:v2.11
docker pull nonfiction/hello-world
docker pull portainer/portainer-ce
docker pull portainer/agent
docker pull nonfiction/workspace
docker pull mysql:8.3.0-oracle
traefik: init stack pull
docker stack deploy -c deploy/stack-traefik.yml platform
docker stack deploy -c deploy/stack-hello-world.yml platform
docker stack deploy -c deploy/stack-portainer-agent.yml platform
docker stack deploy -c deploy/stack-db.yml platform
workspace: traefik
docker stack deploy -c deploy/stack-portainer.yml platform
docker stack deploy --resolve-image never -c deploy/stack-workspace.yml platform