diff --git a/dev-tools/rc-manual-utilities/gh_empty-cache.sh b/dev-tools/rc-manual-utilities/gh_empty-cache.sh new file mode 100644 index 0000000000..f624bbf250 --- /dev/null +++ b/dev-tools/rc-manual-utilities/gh_empty-cache.sh @@ -0,0 +1,21 @@ +set -e + +OWNER='kestra-io' +REPO=$1 + +if [[ -z "$REPO" ]]; then + echo -e "Missing required argument repo\n"; +fi + +echo "get caches for /repo/$OWNER/$REPO/action/caches" + +gh api \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + /repos/$OWNER/$REPO/actions/caches > caches.json + +for id in $(jq -r '.actions_caches[].id' caches.json); do + echo "delete cache with ID: $id" + gh api --method DELETE "/repos/$OWNER/$REPO/actions/caches/$id" +done + diff --git a/dev-tools/rc-manual-utilities/gh_launch-release-workflow.sh b/dev-tools/rc-manual-utilities/gh_launch-release-workflow.sh new file mode 100644 index 0000000000..5161790052 --- /dev/null +++ b/dev-tools/rc-manual-utilities/gh_launch-release-workflow.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# Usage: ./trigger-workflow.sh +set -e + +if [ -z "$1" ]; then + echo "Usage: $0 " + exit 1 +fi + +if [ -z "$2" ]; then + echo "Usage: $0 " + exit 1 +fi + +REPO="$1" +BRANCH="$2" +OWNER="kestra-io" +WORKFLOW="main.yml" + +echo "Triggering workflow '$WORKFLOW' on branch '$BRANCH'..." + +gh workflow run "$WORKFLOW" \ + --repo "$OWNER/$REPO" \ + --ref "$BRANCH" + +echo "Triggered. Run 'gh run list --repo $OWNER/$REPO --branch $BRANCH' to check status." + diff --git a/dev-tools/rc-manual-utilities/gh_restart-main-build-on-branch.sh b/dev-tools/rc-manual-utilities/gh_restart-main-build-on-branch.sh new file mode 100644 index 0000000000..ce4d5a7009 --- /dev/null +++ b/dev-tools/rc-manual-utilities/gh_restart-main-build-on-branch.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -e + +if [ -z "$1" ]; then + echo "Usage: $0 " + exit 1 +fi + +if [ -z "$2" ]; then + echo "Usage: $0 " + exit 1 +fi + +REPO="$1" +BRANCH="$2" + +echo "delete cache and restart build for '$REPO' on branch '$BRANCH'..." +sh ./empty-cache.sh $REPO +sh ./launch-release-workflow.sh $REPO $BRANCH +echo "delete and restart done for '$REPO' on branch '$BRANCH'..." diff --git a/dev-tools/rc-manual-utilities/gh_run-main-workflow-on-all-plugins.sh b/dev-tools/rc-manual-utilities/gh_run-main-workflow-on-all-plugins.sh new file mode 100644 index 0000000000..f2f1b86bde --- /dev/null +++ b/dev-tools/rc-manual-utilities/gh_run-main-workflow-on-all-plugins.sh @@ -0,0 +1,10 @@ +set -e + +OWNER='kestra-io' + +gh repo list "$OWNER" --limit 1000 --json name -q '.[] | select(.name | startswith("plugin-")) | .name' | +while read -r repo; do + echo "Calling script for $repo" + sh launch-release-workflow.sh $repo master & +done +