Created
May 10, 2014 17:49
-
-
Save rochacon/55bcbb05b3f4a49a14bd to your computer and use it in GitHub Desktop.
Simple gitreceive-next hook to build and run a slug with Flynn
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 | |
# | |
# Simple gitreceive-next hook to build and run a slug with Flynn | |
# | |
# This is an old script that I found sitting in my Desktop =P | |
# | |
# Last update: 2014-01-28 | |
# | |
set -e | |
BUCKET="https://s3.amazonaws.com/<BUCKET_NAME>" | |
IMAGE="$BUCKET/$2.tgz" | |
PORT="$RANDOM" | |
URL="http://<HOST>:$PORT" | |
echo '-----> Builing image' | |
cat | docker run -i -a stdin -a stdout -v /tmp/app-cache:/tmp/cache:rw flynn/slugbuilder "$IMAGE" | |
echo '-----> Starting container' | |
id=$(docker run -d -i -e SLUG_URL="$IMAGE" -e PORT=8000 -p $PORT:8000 flynn/slugrunner start web) | |
echo "-----> $URL" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment