Files
dokku/tests/ci/receiver
2013-11-15 03:08:14 +00:00

33 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
set -eo pipefail
export PATH=/usr/local/sbin:/usr/sbin:/sbin:/bin:/usr/bin:/usr/local/bin
unset GIT_DIR
if [[ $2 == *dokku* ]]; then
rm -rf /tmp/build
mkdir /tmp/build
cd /tmp/build
tar -xf -
echo "-----> Installing dependencies"
DEBIAN_FRONTEND=noninteractive apt-get install -y git make curl software-properties-common
echo "-----> Set hostname to dokku.me"
hostname dokku.me
echo "-----> Running make install"
DEBIAN_FRONTEND=noninteractive make install
echo "-----> Generating keypair..."
echo -e "y\n" | ssh-keygen -f /root/.ssh/id_rsa -t rsa -N ''
echo "-----> Installing SSH public key..."
cat /root/.ssh/id_rsa.pub | sudo sshcommand acl-add dokku test
echo "-----> Intitial SSH connection to populate known_hosts..."
ssh -o StrictHostKeyChecking=no dokku@dokku.me help > /dev/null
echo "-----> Running tests"
cd tests
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
else
echo "-----> Repository invalid."
fi