Fix vagrant test setup

This commit is contained in:
Alexander
2013-07-02 00:00:02 +02:00
parent 9623b4c474
commit 5653eedac4
2 changed files with 15 additions and 4 deletions

View File

@@ -1,7 +1,8 @@
#!/bin/bash
SELF=`which $0`
VAGRANT_SSH_PORT=${$VAGRANT_SSH_PORT:-"2222"}
PUBLIC_KEY=${PUBLIC_KEY:-"~/.ssh/id_rsa.pub"}
VAGRANT_SSH_PORT=${VAGRANT_SSH_PORT:-"2222"}
PUBLIC_KEY=${PUBLIC_KEY:-"$HOME/.ssh/id_rsa.pub"}
FORWARDED_PORT=${FORWARDED_PORT:-":8080"}
indent() { sed "s/^/ /"; }
if [[ ! $(cat ~/.ssh/config 2>/dev/null | grep dokku.me) ]]; then
echo "-----> Configuring SSH to use $VAGRANT_SSH_PORT for dokku.me..."
@@ -11,4 +12,14 @@ if [[ ! $(cat ~/.ssh/config 2>/dev/null | grep dokku.me) ]]; then
fi
echo "-----> Ensuring Vagrant is running..."
cd "$(dirname $SELF)/.." && vagrant up | indent
cd "$(dirname $SELF)"
echo "-----> Installing SSH public keys..."
cat $PUBLIC_KEY | ssh -o "StrictHostKeyChecking=no" -i ~/.vagrant.d/insecure_private_key vagrant@dokku.me "sudo gitreceive upload-key test"
cat $PUBLIC_KEY | ssh -o "StrictHostKeyChecking=no" -i ~/.vagrant.d/insecure_private_key vagrant@dokku.me "sudo sshcommand acl-add dokku test"
for app_path in apps/*; do
app=$(basename $app_path)
echo "-----> Running test deploy of $app..."
./test_deploy $app_path dokku.me $FORWARDED_PORT
done