mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 15:15:51 +03:00
Merge pull request #9027 from nextcloud/fix-delete-old-comments-again
scripts/drone: Use deleteOldComments everywhere
This commit is contained in:
commit
770369477a
4 changed files with 6 additions and 24 deletions
|
@ -25,11 +25,11 @@ steps:
|
|||
- ./gradlew assembleGplay
|
||||
- ./gradlew assembleGplayDebug
|
||||
- scripts/wait_for_emulator.sh
|
||||
- scripts/deleteOutdatedComments.sh "stable" "Unit" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
|
||||
- scripts/deleteOldComments.sh "stable" "Unit" $DRONE_PULL_REQUEST $GIT_TOKEN
|
||||
- ./gradlew jacocoTestGplayDebugUnitTestReport || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "stable" "Unit" $DRONE_PULL_REQUEST $GIT_TOKEN
|
||||
- ./gradlew installGplayDebugAndroidTest
|
||||
- scripts/wait_for_server.sh "server"
|
||||
- scripts/deleteOutdatedComments.sh "stable" "IT" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
|
||||
- scripts/deleteOldComments.sh "stable" "IT" $DRONE_PULL_REQUEST $GIT_TOKEN
|
||||
- ./gradlew createGplayDebugCoverageReport -Pcoverage -Pandroid.testInstrumentationRunnerArguments.notAnnotation=com.owncloud.android.utils.ScreenshotTest || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "stable" "IT" $DRONE_PULL_REQUEST $GIT_TOKEN
|
||||
- ./gradlew combinedTestReport
|
||||
- name: notify
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
BRANCH=$1
|
||||
TYPE=$2
|
||||
PR=$3
|
||||
GITHUB_USER=$4
|
||||
GITHUB_PASSWORD=$5
|
||||
BRANCH_TYPE=$BRANCH-$TYPE
|
||||
|
||||
# delete all old comments, matching this type
|
||||
oldComments=$(curl 2>/dev/null -u $GITHUB_USER:$GITHUB_PASSWORD -X GET https://api.github.com/repos/nextcloud/android/issues/$PR/comments | jq --arg TYPE $BRANCH_TYPE '.[] | (.id |tostring) + "|" + (.user.login | test("nextcloud-android-bot") | tostring) + "|" + (.body | test([$TYPE]) | tostring)'| grep "true|true" | tr -d "\"" | cut -f1 -d"|")
|
||||
|
||||
echo $oldComments | while read comment ; do
|
||||
curl 2>/dev/null -u $GITHUB_USER:$GITHUB_PASSWORD -X DELETE https://api.github.com/repos/nextcloud/android/issues/comments/$comment
|
||||
done
|
||||
|
||||
exit 0
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
## $1 noCI/stable/master: wether to run deleteOutdatedComments.sh or uploadReport.sh
|
||||
## $1 noCI/stable/master: wether to run deleteOldComments.sh or uploadReport.sh
|
||||
## $2 true/false: record or verify screenshots
|
||||
## $3 classMethod: piped from androidScreenshotTest
|
||||
## $4 github event number
|
||||
|
@ -42,8 +42,7 @@ do
|
|||
-Pandroid.testInstrumentationRunnerArguments.annotation=com.owncloud.android.utils.ScreenshotTest \
|
||||
-Pandroid.testInstrumentationRunnerArguments.COLOR="$color" \
|
||||
-Pandroid.testInstrumentationRunnerArguments.DARKMODE="$darkMode" </dev/null > /dev/null \
|
||||
&& scripts/deleteOutdatedComments.sh "$1-$darkMode-$color" "Screenshot" "$4" \
|
||||
"$GIT_USERNAME" "$GIT_TOKEN" \
|
||||
&& scripts/deleteOldComments.sh "$1-$darkMode-$color" "Screenshot" "$4" "$GIT_TOKEN" \
|
||||
|| resultCode=1 && scripts/uploadReport.sh "$LOG_USERNAME" "$LOG_PASSWORD" "$4" \
|
||||
"$1-$darkMode-$color" "Screenshot" "$4" "$GIT_TOKEN"
|
||||
fi
|
||||
|
|
|
@ -7,8 +7,8 @@ LOG_USERNAME=$4
|
|||
LOG_PASSWORD=$5
|
||||
DRONE_BUILD_NUMBER=$6
|
||||
|
||||
scripts/deleteOutdatedComments.sh "master" "Unit" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
|
||||
scripts/deleteOutdatedComments.sh "master" "IT" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
|
||||
scripts/deleteOldComments.sh "master" "Unit" $DRONE_PULL_REQUEST $GIT_TOKEN
|
||||
scripts/deleteOldComments.sh "master" "IT" $DRONE_PULL_REQUEST $GIT_TOKEN
|
||||
|
||||
./gradlew assembleGplay
|
||||
./gradlew assembleGplayDebug
|
||||
|
|
Loading…
Reference in a new issue