Last active
August 22, 2019 19:44
-
-
Save pkieltyka/4ab679a692db47e0b410f66b3a4df3ff to your computer and use it in GitHub Desktop.
Short example of a sup tail-logs command
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
# Supfile | |
--- | |
env: | |
NAME: api | |
IMAGE: ecorp/api | |
CONTAINER_PORT: 5000 | |
networks: | |
production: | |
hosts: | |
- user@api1.ecorp.net | |
- user@api2.ecorp.net | |
staging: | |
# fetch dynamic list of hosts | |
inventory: curl http://example.com/latest/meta-data/hostname | |
commands: | |
tail-logs: | |
docker logs -f --tail=20 $NAME | |
run: | |
desc: Run Docker container | |
run: > | |
sudo docker run -d \ | |
-p 80:$CONTAINER_PORT \ | |
--name $NAME $IMAGE | |
stop: | |
desc: Stop running docker container | |
run: docker stop $NAME | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment