From 006e41bcf99818a780ea617aa4de1c6a9c8911be Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Fri, 22 Jun 2018 11:45:00 +0200 Subject: [PATCH] use newest docker-image only for analysis Signed-off-by: tobiasKaminsky --- .drone.yml | 6 +++--- scripts/analysis/analysis-wrapper.sh | 10 +++++----- wait_for_emulator.sh | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.drone.yml b/.drone.yml index 9773f397cd..c7d37f1c79 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,6 +1,6 @@ pipeline: compile: - image: nextcloudci/android:android-36 + image: nextcloudci/android:android-35 commands: # uncomment gplay for Gplay - sh -c "if [ '${FLAVOR}' = 'Gplay' ]; then sed -i '/.*com.google.*/s/^.*\\/\\///g' build.gradle; fi" @@ -11,7 +11,7 @@ pipeline: FLAVOR: [Generic, Gplay] test: - image: nextcloudci/android:android-36 + image: nextcloudci/android:android-35 privileged: true commands: - emulator -avd android-27 -no-window -no-audio & @@ -28,7 +28,7 @@ pipeline: FLAVOR: Gplay analysis: - image: nextcloudci/android:android-36 + image: nextcloudci/android:android-37 commands: # needs gplay - sed -i '/.*com.google.*/s/^.*\\/\\///g' build.gradle diff --git a/scripts/analysis/analysis-wrapper.sh b/scripts/analysis/analysis-wrapper.sh index e29f47b786..8355e2d1bb 100755 --- a/scripts/analysis/analysis-wrapper.sh +++ b/scripts/analysis/analysis-wrapper.sh @@ -37,22 +37,22 @@ else 6="master-"$(date +%F) fi echo "New lint results at https://nextcloud.kaminsky.me/index.php/s/tXwtChzyqMj6I8v ->" $6.html - curl -u $4:$5 -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/droneLogs/$6.html --upload-file build/reports/lint/lint.html + curl 2>/dev/null -u $4:$5 -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/droneLogs/$6.html --upload-file build/reports/lint/lint.html echo "New findbugs results at https://nextcloud.kaminsky.me/index.php/s/fYZa7NeBsnmFZQD ->" $6.html - curl -u $4:$5 -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/findbugs/$6.html --upload-file build/reports/findbugs/findbugs.html + curl 2>/dev/null -u $4:$5 -X PUT https://nextcloud.kaminsky.me/remote.php/webdav/findbugs/$6.html --upload-file build/reports/findbugs/findbugs.html # delete all old comments - oldComments=$(curl -u $1:$2 -X GET https://api.github.com/repos/nextcloud/android/issues/$7/comments | jq '.[] | (.id |tostring) + "|" + (.user.login | test("nextcloud-android-bot") | tostring) ' | grep true | tr -d "\"" | cut -f1 -d"|") + oldComments=$(curl 2>/dev/null -u $1:$2 -X GET https://api.github.com/repos/nextcloud/android/issues/$7/comments | jq '.[] | (.id |tostring) + "|" + (.user.login | test("nextcloud-android-bot") | tostring) ' | grep true | tr -d "\"" | cut -f1 -d"|") echo $oldComments | while read comment ; do - curl -u $1:$2 -X DELETE https://api.github.com/repos/nextcloud/android/issues/comments/$comment + curl 2>/dev/null -u $1:$2 -X DELETE https://api.github.com/repos/nextcloud/android/issues/comments/$comment done # add comment with results lintResult="

Lint

"$(tail -n1 scripts/analysis/lint-results.txt | cut -f2 -d':' |cut -f1 -d'<')"
" findbugsResultNew=$(sed -n "/

Summary<\/h1>/,/

Warnings<\/h1>/p" build/reports/findbugs/findbugs.html |head -n-1 | sed s'/<\/a>//'g | sed s'///'g | sed s'/Summary/FindBugs (new)/' | tr "\"" "\'" | tr -d "\n") - findbugsResultOld=$(curl https://nextcloud.kaminsky.me/index.php/s/YaHngKMM6ERmBeg/download | tr "\"" "\'" | tr -d "\r\n") + findbugsResultOld=$(curl 2>/dev/null https://nextcloud.kaminsky.me/index.php/s/YaHngKMM6ERmBeg/download | tr "\"" "\'" | tr -d "\r\n") curl -u $1:$2 -X POST https://api.github.com/repos/nextcloud/android/issues/$7/comments -d "{ \"body\" : \"$lintResult $findbugsResultNew $findbugsResultOld \" }" if [ $lintValue -eq 2 ]; then diff --git a/wait_for_emulator.sh b/wait_for_emulator.sh index 71df3829ba..75280272ea 100755 --- a/wait_for_emulator.sh +++ b/wait_for_emulator.sh @@ -9,7 +9,7 @@ checkcounter=0 until [[ "$bootanim" =~ "stopped" ]]; do bootanim=`adb -e shell getprop init.svc.bootanim 2>&1` echo "($checkcounter) $bootanim" - if [[ "$bootanim" =~ "not found" ]]; then + if [[ "$bootanim" =~ "not found" || "$bootanim" =~ "error" ]]; then let "failcounter += 1" if [[ $failcounter -gt 3 ]]; then echo "Failed to start emulator"