Created
March 5, 2019 10:17
-
-
Save dmahlow/df388aa6f6427212265fcae940c51d10 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #!/bin/bash -em | |
| IMAGE=contiamo/platform:latest | |
| CONTAINER=contiamo-$(date +%Y%m%d%H%M%S) | |
| URL=http://localhost:4300 | |
| PATH="$PATH:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin:/usr/local/sbin:/usr/local/share/python/" | |
| function checkReady { | |
| curl -s $URL > /dev/null | |
| } | |
| function terminate { | |
| curl -s $URL/terminate | |
| echo "[-] Contiamo has been terminated" | |
| } | |
| trap terminate EXIT | |
| checkReady && echo -e "\n[x] Port 4300 is already in use, aborting." && exit 1 | |
| echo "[o] Contiamo is preparing..." | |
| echo -n " . downloading..." | |
| docker pull $IMAGE > /dev/null 2>&1 | |
| echo " done" | |
| echo -n " . booting" | |
| docker run -ti -d -p 4300:80 --name $CONTAINER --rm -v contiamo-db:/var/lib/postgresql/9.6/main -v contiamo-db-config:/etc/postgresql/9.6/main $IMAGE > /dev/null 2>&1 | |
| until checkReady; do | |
| sleep 2; echo -n '.'; | |
| done | |
| echo " done" | |
| echo "" | |
| echo "[+] Contiamo is now running at $URL" && open $URL | |
| while true; do sleep 60; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment