Skip to content

Commit

Permalink
Merge pull request #1 from rnorth/master
Browse files Browse the repository at this point in the history
Prerequisite changes to allow Java buildpack support
  • Loading branch information
progrium committed Jun 9, 2013
2 parents 7183805 + e6ad0d8 commit 3c3a63a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
14 changes: 13 additions & 1 deletion README.md
Expand Up @@ -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
Expand All @@ -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
Expand Down
12 changes: 9 additions & 3 deletions 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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions receiver
Expand Up @@ -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"
Expand All @@ -31,4 +31,4 @@ if [[ $DOMAIN ]]; then
else
echo " http://$(hostname -i | cut -d' ' -f3):$PORT"
fi
echo
echo

0 comments on commit 3c3a63a

Please sign in to comment.