forked from dokku/dokku
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_vagrant
More file actions
executable file
·25 lines (23 loc) · 1.03 KB
/
Copy pathrun_vagrant
File metadata and controls
executable file
·25 lines (23 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
SELF=`which $0`
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..."
touch ~/.ssh/config
echo "Host dokku.me" >> ~/.ssh/config
echo " Port $VAGRANT_SSH_PORT" >> ~/.ssh/config
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