Files
dokku/tests/run_vagrant

30 lines
967 B
Plaintext
Raw Normal View History

#!/usr/bin/env bash
set -eo pipefail
2014-12-13 18:56:31 -08:00
SELF=$(which $0)
2013-07-02 00:00:02 +02:00
VAGRANT_SSH_PORT=${VAGRANT_SSH_PORT:-"2222"}
PUBLIC_KEY=${PUBLIC_KEY:-"$HOME/.ssh/id_rsa.pub"}
FORWARDED_PORT=${FORWARDED_PORT:-":8080"}
indent() { sed "s/^/ /"; }
2014-12-13 18:56:31 -08:00
if ! grep dokku.me ~/.ssh/config 2>/dev/null; then
echo "-----> Configuring SSH to use $VAGRANT_SSH_PORT for dokku.me..."
touch ~/.ssh/config
2014-12-13 18:56:31 -08:00
{
echo "Host dokku.me"
echo " Port $VAGRANT_SSH_PORT"
echo " RequestTTY yes"
} >> ~/.ssh/config
fi
echo "-----> Ensuring Vagrant is running..."
2014-12-13 18:56:31 -08:00
pushd $PWD > /dev/null
cd "$(dirname $SELF)/.." && vagrant up | indent
2014-12-13 18:56:31 -08:00
popd > /dev/null
2013-07-02 00:00:02 +02:00
echo "-----> Installing SSH public keys..."
2014-12-13 18:56:31 -08:00
ssh -o "StrictHostKeyChecking=no" -i ~/.vagrant.d/insecure_private_key vagrant@dokku.me "sudo sshcommand acl-add dokku test" < $PUBLIC_KEY
2013-07-02 00:00:02 +02:00
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