Merge pull request #1 from rnorth/master

Prerequisite changes to allow Java buildpack support
This commit is contained in:
Jeff Lindsay committed 2013-06-09 15:00:34 -07:00
commit 3c3a63acbb
3 files changed
+25 -7

No files matched your search

+13 -1
View File
@@ -27,7 +27,7 @@ That's it!
## Deploy an App ## 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. 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 $ 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! 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 ## Components
* [Docker](https://github.com/dotcloud/docker) - Container runtime and manager * [Docker](https://github.com/dotcloud/docker) - Container runtime and manager
+9 -3
View File
@@ -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 # Docker and base dependencies
apt-get install -y linux-image-extra-`uname -r` apt-get install -y linux-image-extra-`uname -r`
apt-get install -y software-properties-common apt-get install -y software-properties-common
@@ -8,20 +14,20 @@ apt-get install -y git ruby nginx make
# gitreceive # gitreceive
cd /usr/local/bin cd /usr/local/bin
wget https://raw.github.com/progrium/gitreceive/master/gitreceive wget ${GITRECEIVE_URL}
chmod +x gitreceive chmod +x gitreceive
gitreceive init gitreceive init
# buildstep # buildstep
cd ~ cd ~
git clone https://github.com/progrium/buildstep.git git clone ${BUILDSTEP_REPO}
cd buildstep cd buildstep
cp buildstep /home/git/buildstep cp buildstep /home/git/buildstep
make make
# dokku (this!) # dokku (this!)
cd ~ cd ~
git clone https://github.com/progrium/dokku.git git clone ${DOKKU_REPO}
cd dokku cd dokku
cp receiver /home/git/receiver cp receiver /home/git/receiver
cp nginx-app-conf /home/git/nginx-app-conf cp nginx-app-conf /home/git/nginx-app-conf
+3 -3
View File
@@ -12,10 +12,10 @@ if [[ -f "$HOME/$1/PORT" ]]; then
OLDID=$(< "$HOME/$1/CONTAINER") OLDID=$(< "$HOME/$1/CONTAINER")
docker kill $OLDID > /dev/null docker kill $OLDID > /dev/null
PORT=$(< "$HOME/$1/PORT") 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" echo $ID > "$HOME/$1/CONTAINER"
else 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" echo $ID > "$HOME/$1/CONTAINER"
PORT=$(docker inspect $ID | ruby -e 'require"json";puts JSON.parse(STDIN.read)["NetworkSettings"]["PortMapping"]["5000"]') PORT=$(docker inspect $ID | ruby -e 'require"json";puts JSON.parse(STDIN.read)["NetworkSettings"]["PortMapping"]["5000"]')
echo $PORT > "$HOME/$1/PORT" echo $PORT > "$HOME/$1/PORT"
@@ -31,4 +31,4 @@ if [[ $DOMAIN ]]; then
else else
echo " http://$(hostname -i | cut -d' ' -f3):$PORT" echo " http://$(hostname -i | cut -d' ' -f3):$PORT"
fi fi
echo echo