tartiflette/appci/fetch.sh

44 lines
1.1 KiB
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
2017-09-01 20:21:05 +02:00
# Get the level of this application and the value of each level
LEVELS=$(grep -A10 'Level of this application' data/$APPNAME \
2017-09-01 20:21:05 +02:00
| tail -n11 \
| sed 's/.*: \| (.*//g' \
| sed 's@N/A@X@g' \
| tr -d '\n')
2017-08-26 15:01:31 +02:00
2017-09-01 20:21:05 +02:00
# 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')
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