diff --git a/README.md b/README.md index 4fcd8388d..234c432c8 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ That's it! ## Deploy an App -Right now Buildstep supports the Node.js and Ruby buildpacks. It's not hard to add more, [go add more](https://github.com/progrium/buildstep#adding-buildpacks)! Let's deploy +Right now Buildstep supports the Node.js, Ruby and Java buildpacks. It's not hard to add more, [go add more](https://github.com/progrium/buildstep#adding-buildpacks)! Let's deploy the Heroku Node.js sample app. All you have to do is add a remote to name the app. It's created on-the-fly. $ cd node-js-sample @@ -50,6 +50,18 @@ the Heroku Node.js sample app. All you have to do is add a remote to name the ap You're done! +## Advanced installation (for development) + +The bootstrap script allows source git repository URLs to be overridden to include customizations from your own +repositories. The GITRECEIVE_URL, BUILDSTEP_REPO and DOKKU_REPO environment variables +may be set to override the defaults (see the bootstrap.sh script for how these apply): + +Example: + + $ wget j.mp/dokku-bootstrap + $ chmod +x bootstrap.sh + $ DOKKU_REPO=https://github.com/yourusername/dokku.git bootstrap.sh + ## Components * [Docker](https://github.com/dotcloud/docker) - Container runtime and manager diff --git a/bootstrap.sh b/bootstrap.sh index db0cc7a63..6399016a4 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,3 +1,9 @@ +# Repository locations - set environment variables to override defaults +# e.g. OVERRIDE_DOKKU_REPO=https://github.com/yourusername/dokku.git bootstrap.sh +GITRECEIVE_URL=${GITRECEIVE_URL:-"https://raw.github.com/progrium/gitreceive/master/gitreceive"} +BUILDSTEP_REPO=${BUILDSTEP_REPO:-"https://github.com/progrium/buildstep.git"} +DOKKU_REPO=${DOKKU_REPO:-"https://github.com/progrium/dokku.git"} + # Docker and base dependencies apt-get install -y linux-image-extra-`uname -r` apt-get install -y software-properties-common @@ -8,20 +14,20 @@ apt-get install -y git ruby nginx make # gitreceive cd /usr/local/bin -wget https://raw.github.com/progrium/gitreceive/master/gitreceive +wget ${GITRECEIVE_URL} chmod +x gitreceive gitreceive init # buildstep cd ~ -git clone https://github.com/progrium/buildstep.git +git clone ${BUILDSTEP_REPO} cd buildstep cp buildstep /home/git/buildstep make # dokku (this!) cd ~ -git clone https://github.com/progrium/dokku.git +git clone ${DOKKU_REPO} cd dokku cp receiver /home/git/receiver cp nginx-app-conf /home/git/nginx-app-conf diff --git a/receiver b/receiver index 2c3cc2a2e..c142b036b 100755 --- a/receiver +++ b/receiver @@ -12,10 +12,10 @@ if [[ -f "$HOME/$1/PORT" ]]; then OLDID=$(< "$HOME/$1/CONTAINER") docker kill $OLDID > /dev/null PORT=$(< "$HOME/$1/PORT") - ID=$(docker run -d -p ":$PORT" -e "PORT=$PORT" $APP /bin/bash -c "cd /app && ./start") + ID=$(docker run -d -p ":$PORT" -e "PORT=$PORT" $APP /bin/bash -c "if [ -d /app/.profile.d ]; then source /app/.profile.d/*; fi; cd /app && ./start") echo $ID > "$HOME/$1/CONTAINER" else - ID=$(docker run -d -p 5000 -e PORT=5000 $APP /bin/bash -c "cd /app && ./start") + ID=$(docker run -d -p 5000 -e PORT=5000 $APP /bin/bash -c "if [ -d /app/.profile.d ]; then source /app/.profile.d/*; fi; cd /app && ./start") echo $ID > "$HOME/$1/CONTAINER" PORT=$(docker inspect $ID | ruby -e 'require"json";puts JSON.parse(STDIN.read)["NetworkSettings"]["PortMapping"]["5000"]') echo $PORT > "$HOME/$1/PORT" @@ -31,4 +31,4 @@ if [[ $DOMAIN ]]; then else echo " http://$(hostname -i | cut -d' ' -f3):$PORT" fi -echo +echo \ No newline at end of file