]> git.evergreen-ils.org Git - working/random.git/blob - qa/test.sh
some tweaks by miker to the test launcher
[working/random.git] / qa / test.sh
1 #!/bin/bash
2 . /home/live/.bashrc
3
4 export TARGET_USER=esi
5 export TARGET_HOST=192.168.25.129
6 export TARGET_PATH=/home/esi/
7 export LOCAL_QA_GIT_PATH=/home/live/git/random/
8 export LOCAL_QA_BRANCH=collab/phasefx/wheezy_installer
9 export LOCAL_HTML_PATH=/home/live/public_html/
10
11 echo -n "*** Changing to $LOCAL_QA_GIT_PATH ... "
12 cd $LOCAL_QA_GIT_PATH || exit -1
13 echo "location changed"
14
15 echo "*** Checking out $LOCAL_QA_BRANCH ..."
16 git checkout $LOCAL_QA_BRANCH || exit -1
17 git fetch --all || exit -1
18 git pull || exit -1
19 echo "*** Local branch updated"
20
21 echo "*** Pushing installer script to $TARGET_USER@$TARGET_HOST:$TARGET_PATH"
22 scp installer/wheezy/installer_installer.sh $TARGET_USER@$TARGET_HOST:$TARGET_PATH || exit -1
23 echo "*** Script pushed"
24
25 echo "*** Archiving previous test run"
26 cd $LOCAL_HTML_PATH || exit -1
27 export ARCHIVE_DIR=`date +%F_%T` || exit -1
28 mkdir -p archive/$ARCHIVE_DIR || exit -1
29 mv *.* archive/$ARCHIVE_DIR || exit -1
30 cp archive/$ARCHIVE_DIR/*.hash . || exit -1
31 echo "*** Test archived"
32
33 echo "*** Setting up new output"
34 cp $LOCAL_QA_GIT_PATH/qa/test_output.css .
35 echo '<html><head></head><body><h1>Testing in progress</h1><a href="archive/">Previous runs...</a></body></html>' > test.html
36 ln -s test.html index.html
37 echo "*** Ready to test!"
38
39 echo -n "*** Test starting ... "
40 ssh $TARGET_USER@$TARGET_HOST $TARGET_PATH/installer_installer.sh 2>&1 > output.txt
41 echo "test run complete."
42
43 echo "*** Creating web output"
44 $LOCAL_QA_GIT_PATH/qa/test_output_webifier.pl output.txt 
45