mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
first pass at fully functional test infrastructure to work with travis ci
This commit is contained in:
3
tests/apps/nodejs-express/check_deploy
Executable file
3
tests/apps/nodejs-express/check_deploy
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
test "$(curl $1)" == "nodejs/express2"
|
||||
@@ -12,7 +12,7 @@ terminate() {
|
||||
echo "-----> Terminating $INSTANCE..."
|
||||
ec2-terminate-instances $INSTANCE &>/dev/null && echo " Shutting down"
|
||||
}
|
||||
[[ $DEBUG ]] || trap "terminate" EXIT
|
||||
[[ $NOCLEANUP ]] || trap "terminate" EXIT
|
||||
sleep 30
|
||||
status=""
|
||||
while [[ "$status" != "running" ]]; do
|
||||
@@ -32,4 +32,12 @@ while [[ ! $(echo | nc $PUBLIC_IP 22) ]]; do
|
||||
echo " Waiting..."
|
||||
done
|
||||
echo "-----> Connecting and running boostrap script..."
|
||||
cat ../bootstrap.sh | ssh -o "StrictHostKeyChecking=no" ubuntu@$PUBLIC_IP "HOSTNAME=$PUBLIC_IP sudo bash" 2>&1 | indent
|
||||
cat ../bootstrap.sh | ssh -o "StrictHostKeyChecking=no" ubuntu@$PUBLIC_IP "HOSTNAME=$PUBLIC_IP sudo bash" 2>&1 | indent
|
||||
echo "-----> Installing SSH public keys..."
|
||||
ssh-add -L | ssh -o "StrictHostKeyChecking=no" ubuntu@$PUBLIC_IP "sudo gitreceive upload-key test" > /dev/null
|
||||
ssh-add -L | ssh -o "StrictHostKeyChecking=no" ubuntu@$PUBLIC_IP "sudo sshcommand acl-add dokku test" > /dev/null
|
||||
for app_path in apps/*; do
|
||||
app=$(basename $app_path)
|
||||
echo "-----> Running test deploy of $app..."
|
||||
./test_deploy $app_path $PUBLIC_IP
|
||||
done
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
# set -e
|
||||
set -e
|
||||
SELF=`which $0`; APP="$1"; TARGET="$2"
|
||||
TMP=$(mktemp -d -t $TARGET)
|
||||
trap "rm -rf $TMP" EXIT
|
||||
@@ -11,11 +11,5 @@ git commit -m 'initial commit'
|
||||
REPO="test-$RANDOM"
|
||||
git remote add target git@$TARGET:$REPO
|
||||
URL_FILE=$(mktemp -t url)
|
||||
git push target master 2>&1 | while read line; do
|
||||
echo "$line"
|
||||
[[ $(echo "$line" | grep $TARGET | grep remote) ]] && echo "$line" | awk '{print $2}' > $URL_FILE
|
||||
done
|
||||
set -x
|
||||
URL=$(<$URL_FILE)
|
||||
curl -v "$URL:8080" # GAHAHHHHH WHY DOESNT THIS WORK
|
||||
rm $URL_FILE
|
||||
git push target master
|
||||
./check_deploy "$(ssh dokku@$TARGET url $REPO)" && echo "-----> Deploy success!"
|
||||
Reference in New Issue
Block a user