Created
November 5, 2017 11:14
-
-
Save MartinSchmidt123/b3e230ad409746547031ab7556ed4e94 to your computer and use it in GitHub Desktop.
Makefile for common commands used with a docker swarm cluster
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name=$(shell basename $(CURDIR)) | |
ls = docker stack services ${name} | |
rm = docker stack rm ${name} | |
deploy = docker stack deploy -c docker-stack.yml ${name} | |
build = docker-compose -f docker-compose.yml build | |
logs = multitail $(shell docker stack services --format "{{.Name}}" ${name} | xargs -n1 sh -c 'echo -l \"docker service logs --raw -f $${@}\"\ ' "$${0}") | |
ls: | |
$(ls) | |
rm: | |
$(rm) | |
build: | |
$(build) | |
deploy: | |
$(deploy) | |
logs: | |
$(logs) | |
full: | |
$(rm) | |
$(deploy) | |
$(logs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment