This repository has been archived on 2020-09-29. You can view files and clone it, but cannot push or open issues or pull requests.
traefik.autonomic.zone/Makefile

32 lines
823 B
Makefile
Raw Normal View History

2020-04-25 10:38:11 +00:00
COMPOSE_FILE := docker-compose.yml
2020-04-28 12:46:09 +00:00
CONFIG := $$HOME/.docker
2020-04-25 10:58:47 +00:00
NETWORK := proxy
2020-04-28 12:46:09 +00:00
STACK := traefik
SWARM_URL := tcp://swarm.autonomic.zone:2376
2020-04-25 10:38:11 +00:00
2020-04-25 10:30:42 +00:00
default: deploy
deploy:
2020-04-25 10:38:11 +00:00
@docker stack deploy -c $(COMPOSE_FILE) $(STACK)
down:
@docker stack rm $(STACK)
2020-04-25 10:30:42 +00:00
2020-04-25 10:58:47 +00:00
network:
@docker network create --driver=overlay $(NETWORK)
logs:
@docker service logs -f $(STACK)_$(STACK)
2020-04-28 12:46:09 +00:00
config:
mkdir -vp $(CONFIG) && \
pass show docker/swarm.autonomic.zone/ca.pem > $(CONFIG)/ca.pem && \
pass show docker/swarm.autonomic.zone/cert.pem > $(CONFIG)/cert.pem && \
pass show docker/swarm.autonomic.zone/key.pem > $(CONFIG)/key.pem
context:
@docker context create swarm.autonomic.zone --docker \
"host=$(SWARM_URL),ca=$(CONFIG)/ca.pem,cert=$(CONFIG)/cert.pem,key=$(CONFIG)/key.pem"
.PHONY: deploy down network logs context