btrfs-progs: ci: update cleanup scripts
Add limit parameter so workflows are not skipped if they don't fit the default limit 10. Add more workflows to clean up after recent updates. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
a00c2b2547
commit
7c3b897803
|
@ -8,7 +8,7 @@ repo="kdave/btrfs-progs"
|
|||
type -p gh > /dev/null || { echo "ERROR: gh tool not found"; exit 1; }
|
||||
type -p jq > /dev/null || { echo "ERROR: jq tool not found"; exit 1; }
|
||||
|
||||
for id in $(gh run -R "$repo" list --workflow "$workflow" --status failure --json databaseId | jq '.[].databaseId'); do
|
||||
for id in $(gh run -R "$repo" list --limit 100 --workflow "$workflow" --status failure --json databaseId | jq '.[].databaseId'); do
|
||||
echo "Delete run $id"
|
||||
gh run -R "$repo" delete "$id"
|
||||
done
|
||||
|
|
|
@ -16,11 +16,13 @@ notthatone() {
|
|||
exit 1
|
||||
}
|
||||
|
||||
areyousure() {
|
||||
echo "WARNING: protected branch, make sure you want to remove it: $1"
|
||||
}
|
||||
|
||||
case "$branch" in
|
||||
master) notthatone "$branch";;
|
||||
devel) notthatone "$branch";;
|
||||
coverage-test) notthatone "$branch";;
|
||||
release-test) notthatone "$branch";;
|
||||
devel) areyousure "$branch";;
|
||||
esac
|
||||
|
||||
echo "Delete all runs of branch $branch, are you sure? [y/N]"
|
||||
|
@ -31,7 +33,7 @@ if ! [ "$answer" = 'y' ]; then
|
|||
fi
|
||||
echo
|
||||
|
||||
for id in $(gh run -R "$repo" list --json databaseId --branch "$branch" | jq '.[].databaseId'); do
|
||||
for id in $(gh run -R "$repo" list --limit 100 --json databaseId --branch "$branch" | jq '.[].databaseId'); do
|
||||
echo "Delete run $id"
|
||||
gh run -R "$repo" delete "$id"
|
||||
done
|
||||
|
|
|
@ -9,7 +9,7 @@ type -p gh > /dev/null || { echo "ERROR: gh tool not found"; exit 1; }
|
|||
type -p jq > /dev/null || { echo "ERROR: jq tool not found"; exit 1; }
|
||||
|
||||
for branch in master release-test; do
|
||||
for id in $(gh run -R "$repo" list --workflow "$workflow" --branch "$branch" --json databaseId | jq '.[1:] | .[].databaseId'); do
|
||||
for id in $(gh run -R "$repo" list --limit 100 --workflow "$workflow" --branch "$branch" --json databaseId | jq '.[1:] | .[].databaseId'); do
|
||||
echo "Delete run $id"
|
||||
gh run -R "$repo" delete "$id"
|
||||
done
|
||||
|
|
|
@ -9,7 +9,7 @@ type -p gh > /dev/null || { echo "ERROR: gh tool not found"; exit 1; }
|
|||
type -p jq > /dev/null || { echo "ERROR: jq tool not found"; exit 1; }
|
||||
|
||||
for branch in master coverage-test; do
|
||||
for id in $(gh run -R "$repo" list --workflow "$workflow" --branch "$branch" --json databaseId | jq '.[1:] | .[].databaseId'); do
|
||||
for id in $(gh run -R "$repo" list --limit 100 --workflow "$workflow" --branch "$branch" --json databaseId | jq '.[1:] | .[].databaseId'); do
|
||||
echo "Delete run $id"
|
||||
gh run -R "$repo" delete "$id"
|
||||
done
|
||||
|
|
|
@ -7,7 +7,7 @@ repo="kdave/btrfs-progs"
|
|||
|
||||
from=11
|
||||
|
||||
for id in $(gh run -R "$repo" list -w 'Devel build and tests' --json databaseId | jq '.[].databaseId' | tail -n +${from}); do
|
||||
for id in $(gh run -R "$repo" list --limit 100 --workflow 'Devel build and tests' --json databaseId | jq '.[].databaseId' | tail -n +${from}); do
|
||||
echo "Delete run $id"
|
||||
gh run -R "$repo" delete "$id"
|
||||
done
|
||||
|
|
|
@ -9,7 +9,7 @@ type -p gh > /dev/null || { echo "ERROR: gh tool not found"; exit 1; }
|
|||
type -p jq > /dev/null || { echo "ERROR: jq tool not found"; exit 1; }
|
||||
|
||||
for branch in master release-test; do
|
||||
for id in $(gh run -R "$repo" list --workflow "$workflow" --branch "$branch" --json databaseId | jq '.[1:] | .[].databaseId'); do
|
||||
for id in $(gh run -R "$repo" list --limit 100 --workflow "$workflow" --branch "$branch" --json databaseId | jq '.[1:] | .[].databaseId'); do
|
||||
echo "Delete run $id"
|
||||
gh run -R "$repo" delete "$id"
|
||||
done
|
||||
|
|
|
@ -11,7 +11,7 @@ daysmax=8
|
|||
|
||||
clean_workflow() {
|
||||
local wf="$1"
|
||||
local json=$(gh run -R "$repo" list --workflow "$wf" --json databaseId,startedAt)
|
||||
local json=$(gh run -R "$repo" list --limit 100 --workflow "$wf" --json databaseId,startedAt)
|
||||
|
||||
echo "Cleaning workflow $wf"
|
||||
i=0
|
||||
|
@ -40,3 +40,6 @@ clean_workflow() {
|
|||
clean_workflow "Testing CI build"
|
||||
clean_workflow "Devel build and tests"
|
||||
clean_workflow "Pull request build and tests"
|
||||
clean_workflow "Codespell"
|
||||
clean_workflow "CI image tests"
|
||||
clean_workflow "Sanitizer checks"
|
||||
|
|
|
@ -16,8 +16,8 @@ repo="kdave/btrfs-progs"
|
|||
tag="$1"
|
||||
# TODO: verify that tag exists
|
||||
|
||||
# Read last workflow id
|
||||
id=$(gh run -R "$repo" list -w 'Static binaries' -L 1 --json databaseId | jq '.[].databaseId')
|
||||
# Read last workflow id for master branch
|
||||
id=$(gh run -R "$repo" list --limit 1 --workflow 'Static binaries' --branch 'master' --json databaseId | jq '.[].databaseId')
|
||||
|
||||
for asset in btrfs.box.static btrfs.static; do
|
||||
gh run -R "$repo" download "$id" -n "$asset"
|
||||
|
|
Loading…
Reference in New Issue