tartiflette/appci/fetch.sh

37 lines
860 B
Bash
Raw Normal View History

2017-08-29 00:11:22 +02:00
#!/bin/bash
2017-08-26 15:01:31 +02:00
python fetchlist.py | sort > list_apps
2017-08-26 15:01:31 +02:00
while read APP;
do
APPNAME=$(echo $APP | awk '{print $1}')
echo $APPNAME
wget -q -O data/$APPNAME "https://ci-apps.yunohost.org/jenkins/job/$APP/lastBuild/consoleText" --prefer-family=IPv4
2017-08-26 15:01:31 +02:00
TESTS_RESULTS=""
while read TESTNAME
do
RESULTS=$(grep "^$TESTNAME:" data/$APPNAME)
if echo $RESULTS | grep -q "FAIL"
then
TESTS_RESULTS="${TESTS_RESULTS}0"
elif echo $RESULTS | grep -q "SUCCESS"
then
TESTS_RESULTS="${TESTS_RESULTS}1"
else
TESTS_RESULTS="${TESTS_RESULTS}X"
fi
done < list_tests
LEVELS=$(grep -A10 'Level of this application' data/$APPNAME \
| tail -n 11 \
| sed -e 's@N/A@X@g' -e 's/ Level //g' -e 's/Level of this application//g' \
| awk '{print $2}' \
| tr -d '\n')
2017-08-26 15:01:31 +02:00
echo $TESTS_RESULTS > data/$APPNAME
2017-08-26 15:01:31 +02:00
echo $LEVELS >> data/$APPNAME
done < list_apps
2017-08-26 15:01:31 +02:00