pipeline siivous ja testikattavuuden nosto (#9)
CI / load-config (push) Successful in 16s
CI / feature (push) Has been skipped
ci-cucumber Cucumber tests passed
ci-bats Bats tests
ci-build Build complete
CI / main (push) Successful in 2m23s

Co-authored-by: moilanik <niko.moilanen@tietoevry.com>
Reviewed-on: #9
This commit is contained in:
2026-06-14 03:26:44 +03:00
parent a1d1f1e5ab
commit c422825bf0
33 changed files with 779 additions and 302 deletions
+5 -4
View File
@@ -1,20 +1,21 @@
#!/usr/bin/env bash
set -euo pipefail
[ -z "${GITEA_API_URL:-}" ] && echo "ERROR: GITEA_API_URL is not set" >&2 && exit 1
[ -z "${GITEA_TOKEN:-}" ] && echo "ERROR: GITEA_TOKEN is not set" >&2 && exit 1
TARGET_REPO="${1:-}"
WORKFLOW_FILE="${2:-}"
REF="${3:-}"
INPUTS_JSON="${4:-}"
TIMEOUT_MINUTES="${5:-360}"
GITEA_API_URL="${5:-}"
GITEA_TOKEN="${6:-}"
TIMEOUT_MINUTES="${7:-360}"
POLL_INTERVAL="${DISPATCH_POLL_INTERVAL:-10}"
[ -z "$TARGET_REPO" ] && echo "ERROR: target_repo argument is required" >&2 && exit 1
[ -z "$WORKFLOW_FILE" ] && echo "ERROR: workflow_file argument is required" >&2 && exit 1
[ -z "$REF" ] && echo "ERROR: ref argument is required" >&2 && exit 1
[ -z "$INPUTS_JSON" ] && echo "ERROR: inputs_json argument is required" >&2 && exit 1
[ -z "$GITEA_API_URL" ] && echo "ERROR: gitea_api_url argument is required" >&2 && exit 1
[ -z "$GITEA_TOKEN" ] && echo "ERROR: gitea_token argument is required" >&2 && exit 1
DISPATCH_URL="$GITEA_API_URL/api/v1/repos/$TARGET_REPO/actions/workflows/$WORKFLOW_FILE/dispatches"
DISPATCH_BODY=$(jq -nc --arg ref "$REF" --argjson inputs "$INPUTS_JSON" '{ref: $ref, inputs: $inputs}')