From b732fc58c088e0962a160daab44ca0b6b264606a Mon Sep 17 00:00:00 2001 From: Jeff Lindsay Date: Fri, 8 Nov 2013 13:45:12 -0800 Subject: [PATCH] ci stuff --- tests/ci/boot.sh | 26 ++++++++++++++++++++++++++ tests/ci/receiver | 27 +++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100755 tests/ci/boot.sh create mode 100755 tests/ci/receiver diff --git a/tests/ci/boot.sh b/tests/ci/boot.sh new file mode 100755 index 000000000..c7b181572 --- /dev/null +++ b/tests/ci/boot.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +set -eo pipefail + +export DEBIAN_FRONTEND=noninteractive +apt-get install -y git make curl + +cd /tmp + +wget http://j.mp/godeb +tar -zxvf ./godeb +./godeb install 1.1.2 + +git clone https://github.com/flynn/gitreceive-next.git +cd gitreceive-next && make install + +curl https://raw.github.com/progrium/dokku/master/tests/ci/receiver -s > /tmp/receiver +chmod +x /tmp/receiver + +ssh-keygen -f $HOME/.ssh/id_rsa -t rsa -N '' + +cat< /etc/init/gitreceived.conf +start on runlevel [2345] +exec /usr/local/bin/gitreceived -p 2022 -n /root/.ssh/id_rsa /tmp/receiver +EOF + +start gitreceived \ No newline at end of file diff --git a/tests/ci/receiver b/tests/ci/receiver new file mode 100755 index 000000000..57c006e59 --- /dev/null +++ b/tests/ci/receiver @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +set -eo pipefail + +if [[ $3 == *dokku* ]]; then + mkdir $HOME/build + cd $HOME/build + tar -xf - + echo "-----> Installing dependencies" + sudo DEBIAN_FRONTEND=noninteractive apt-get install -y git make curl software-properties-common + echo "-----> Running make install" + sudo DEBIAN_FRONTEND=noninteractive HOSTNAME=dokku.me make install + echo "-----> Generating keypair..." + ssh-keygen -f $HOME/.ssh/id_rsa -t rsa -N '' + echo "-----> Installing SSH public key..." + cat ~/.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 + 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 \ No newline at end of file