diff --git a/.travis.yml b/.travis.yml index e332e44f3..6bf7f28e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ --- -script: cd tests && ./run_ec2 test +script: cd tests && ./run_ec2 test $TRAVIS_BRANCH before_install: - "sudo apt-get install -y ec2-api-tools" - "sudo apt-get install -y s3cmd" diff --git a/bootstrap.sh b/bootstrap.sh index 1cbbd40dd..7a003ba9d 100644 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,4 +1,4 @@ -DOKKU_REPO=${DOKKU_REPO:-"https://github.com/progrium/dokku.git"} +DOKKU_REPO=${DOKKU_REPO:-"https://github.com/progrium/dokku.git"}; DOKKU_BRANCH=${DOKKU_BRANCH:-"master"} DOKKU_STACK=${DOKKU_STACK:-"https://s3.amazonaws.com/progrium-dokku/progrium_buildstep.tgz"} set -e @@ -8,7 +8,7 @@ add-apt-repository -y ppa:dotcloud/lxc-docker apt-get update && apt-get install -y lxc-docker git nginx make curl dnsutils cd ~ && git clone ${DOKKU_REPO} -cd dokku && make install +cd dokku && git pull origin $DOKKU_BRANCH && make install curl "$DOKKU_STACK" | gunzip -cd | docker import - progrium/buildstep diff --git a/tests/run_ec2 b/tests/run_ec2 index dd302817d..eb777a4e4 100755 --- a/tests/run_ec2 +++ b/tests/run_ec2 @@ -1,5 +1,5 @@ #!/bin/bash -KEYNAME="$1" +KEYNAME="$1"; BRANCH=${1:-"master"} indent() { sed "s/^/ /"; } echo "-----> Booting EC2 instance..." start=$(ec2-run-instances -k $1 ami-f3d1bb9a 2>&1 ) @@ -33,7 +33,7 @@ while [[ ! $(echo | nc $PUBLIC_IP 22) ]]; do done set -e echo "-----> Connecting and running boostrap script..." -cat ../bootstrap.sh | ssh -o "StrictHostKeyChecking=no" ubuntu@$PUBLIC_IP "HOSTNAME=$PUBLIC_IP sudo bash" 2>&1 | indent +cat ../bootstrap.sh | ssh -o "StrictHostKeyChecking=no" ubuntu@$PUBLIC_IP "HOSTNAME=$PUBLIC_IP DOKKU_BRANCH=$BRANCH sudo bash" 2>&1 | indent echo "-----> Installing SSH public keys..." cat ~/.ssh/id_rsa.pub | ssh -o "StrictHostKeyChecking=no" ubuntu@$PUBLIC_IP "sudo gitreceive upload-key test" > /dev/null cat ~/.ssh/id_rsa.pub | ssh -o "StrictHostKeyChecking=no" ubuntu@$PUBLIC_IP "sudo sshcommand acl-add dokku test" > /dev/null