create result HTML file
This commit is contained in:
parent
b7348a9deb
commit
21462b600b
33
sitespeed.io
33
sitespeed.io
|
|
@ -62,16 +62,35 @@ done)
|
||||||
|
|
||||||
result=($(printf '%s\n' "${links[@]}"|sort|uniq))
|
result=($(printf '%s\n' "${links[@]}"|sort|uniq))
|
||||||
|
|
||||||
RESULT_DIR="sitespeed-result"
|
REPORT_DIR="sitespeed-result/sitespeed-$HOST-$NOW"
|
||||||
if [ ! -d $RESULT_DIR ]; then
|
REPORT_DATA_DIR="$REPORT_DIR/data"
|
||||||
mkdir $RESULT_DIR
|
mkdir -p $REPORT_DIR
|
||||||
fi
|
mkdir $REPORT_DATA_DIR
|
||||||
|
|
||||||
|
echo "Will create result file: $REPORT_DATA_DIR/result.xml"
|
||||||
|
|
||||||
|
echo '<?xml version="1.0" encoding="UTF-8"?><document host="'$HOST'" url="'$URL'">' >> $REPORT_DATA_DIR/result.xml
|
||||||
|
|
||||||
echo "Will create result file: $RESULT_DIR/sitespeed-$HOST-$NOW.txt"
|
|
||||||
for i in "${result[@]}"
|
for i in "${result[@]}"
|
||||||
do
|
do
|
||||||
echo "Analyzing $i"
|
echo "Analyzing $i"
|
||||||
phantomjs dependencies/yslow.js $i >> $RESULT_DIR/sitespeed-$HOST-$NOW.txt
|
phantomjs dependencies/yslow.js -f xml $i | cut -c39- >> $REPORT_DATA_DIR/result.xml
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Finished"
|
echo '</document>'>> $REPORT_DATA_DIR/result.xml
|
||||||
|
|
||||||
|
echo 'Create the HTML'
|
||||||
|
|
||||||
|
java -jar dependencies/xml-velocity-1.0-full.jar $REPORT_DATA_DIR/result.xml report/velocity/pages.vm pages.properties $REPORT_DIR/report.html
|
||||||
|
|
||||||
|
|
||||||
|
#copy the rest of the files
|
||||||
|
mkdir $REPORT_DIR/css
|
||||||
|
mkdir $REPORT_DIR/js
|
||||||
|
mkdir $REPORT_DIR/img
|
||||||
|
|
||||||
|
cp report/css/* $REPORT_DIR/css
|
||||||
|
cp report/js/* $REPORT_DIR/js
|
||||||
|
cp report/img/* $REPORT_DIR/img
|
||||||
|
|
||||||
|
echo "Finished, see the report $REPORT_DIR/report.html"
|
||||||
Loading…
Reference in New Issue