diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..6616887a6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +index.html +result_cache.html diff --git a/toci.sh b/toci.sh index d9f0c9410..7f03cb023 100755 --- a/toci.sh +++ b/toci.sh @@ -32,11 +32,22 @@ fi if [ ${TOCI_UPLOAD:-0} == 1 ] ; then cd $(dirname $TOCI_LOG_DIR) tar -czf - $(basename $TOCI_LOG_DIR) | ssh ec2-user@$TOCI_RESULTS_SERVER tar -C /var/www/html/toci -xzf - + touch result_cache.html + mv result_cache.html result_cache.html.bck + echo "" > index.html if [ $STATUS == 0 ] ; then - ssh ec2-user@$TOCI_RESULTS_SERVER "echo \$STARTTIME : OK\\
>> /var/www/html/toci/index.html ; chmod -R 775 /var/www/html/toci/*" + echo "
$STARTTIME : OK\\
" > result_cache.html else - ssh ec2-user@$TOCI_RESULTS_SERVER "echo \
$STARTTIME : ERR\\
>> /var/www/html/toci/index.html ; chmod -R 775 /var/www/html/toci/*" + echo "
$STARTTIME : ERR\\
" > result_cache.html fi + # keep only the last 100 runs + head -n 100 result_cache.html.bck >> result_cache.html + rm result_cache.html.bck + cat result_cache.html >> index.html + echo "" >> index.html + + scp index.html ec2-user@$TOCI_RESULTS_SERVER:/var/www/html/toci/index.html + fi if [ ${TOCI_REMOVE:-1} == 1 ] ; then