Fix pipeline pipeline validation by providing auth token to ping endpoints
This commit is contained in:
parent
caf541995e
commit
1c79d1ad01
1
.github/workflows/pipeline.yml
vendored
1
.github/workflows/pipeline.yml
vendored
@ -55,6 +55,7 @@ jobs:
|
||||
id: production_state
|
||||
env:
|
||||
BRIDGE_SERVER_URL: https://xworkmate-bridge.svc.plus
|
||||
BRIDGE_AUTH_TOKEN: ${{ secrets.INTERNAL_SERVICE_TOKEN }}
|
||||
run: |
|
||||
while IFS='=' read -r key value; do
|
||||
echo "${key}=${value}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
@ -34,6 +34,7 @@ ping_json="$(
|
||||
--fail \
|
||||
--location \
|
||||
--max-time 20 \
|
||||
-H "Authorization: Bearer ${BRIDGE_AUTH_TOKEN}" \
|
||||
"${BRIDGE_SERVER_URL%/}/api/ping"
|
||||
)"
|
||||
PING_JSON="${ping_json}" python3 - <<'PY'
|
||||
|
||||
@ -23,15 +23,21 @@ ping_json=""
|
||||
attempts=6
|
||||
sleep_seconds=5
|
||||
|
||||
curl_args=(
|
||||
--silent
|
||||
--show-error
|
||||
--fail
|
||||
--location
|
||||
--max-time 20
|
||||
)
|
||||
|
||||
if [[ -n "${BRIDGE_AUTH_TOKEN:-}" ]]; then
|
||||
curl_args+=(-H "Authorization: Bearer ${BRIDGE_AUTH_TOKEN}")
|
||||
fi
|
||||
|
||||
for ((attempt = 1; attempt <= attempts; attempt += 1)); do
|
||||
if ping_json="$(
|
||||
curl \
|
||||
--silent \
|
||||
--show-error \
|
||||
--fail \
|
||||
--location \
|
||||
--max-time 20 \
|
||||
"${ping_url}"
|
||||
curl "${curl_args[@]}" "${ping_url}"
|
||||
)"; then
|
||||
if [[ -n "${ping_json}" ]]; then
|
||||
break
|
||||
|
||||
@ -39,6 +39,7 @@ fast_http_curl_common=(
|
||||
--fail
|
||||
--location
|
||||
--max-time "${FAST_HTTP_TIMEOUT_SECONDS}"
|
||||
-H "Authorization: Bearer ${AUTH_TOKEN}"
|
||||
)
|
||||
|
||||
bridge_rpc_curl_common=(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user