ci: temporary probe that CANONIZE_TOKEN reaches the pipeline
Runs only on a web pipeline started with TEST_CANONIZE=1, pushes a throwaway ref and deletes it again, and never touches main. Removed after the test. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
dfb88a375e
commit
e055ec511d
@@ -200,3 +200,37 @@ canonize_wiki:
|
|||||||
- git clone --bare --quiet https://rohana.axion1337.de/sorb/ThreadNetWiki.git /tmp/wiki.git
|
- git clone --bare --quiet https://rohana.axion1337.de/sorb/ThreadNetWiki.git /tmp/wiki.git
|
||||||
- GIT_SSL_CAINFO="$LABCA" git -C /tmp/wiki.git push "https://oauth2:${WIKI_CANONIZE_TOKEN}@${CI_SERVER_HOST}/axion1337.chat/threadnet-wiki.git" 'refs/heads/main:refs/heads/main'
|
- GIT_SSL_CAINFO="$LABCA" git -C /tmp/wiki.git push "https://oauth2:${WIKI_CANONIZE_TOKEN}@${CI_SERVER_HOST}/axion1337.chat/threadnet-wiki.git" 'refs/heads/main:refs/heads/main'
|
||||||
- echo "git.lab threadnet-wiki spiegelt jetzt Gitea sorb/ThreadNetWiki (main)."
|
- echo "git.lab threadnet-wiki spiegelt jetzt Gitea sorb/ThreadNetWiki (main)."
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# TEMPORAER (2026-08-19): beweist, dass CANONIZE_TOKEN in der Pipeline ankommt
|
||||||
|
# und schreiben darf - OHNE main anzufassen. Laeuft nur, wenn eine Web-Pipeline
|
||||||
|
# ausdruecklich mit TEST_CANONIZE=1 gestartet wird. Wird nach dem Test entfernt.
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
canonize_token_test:
|
||||||
|
stage: pruefen
|
||||||
|
image: alpine:3.20
|
||||||
|
rules:
|
||||||
|
- if: $CI_PIPELINE_SOURCE == "web" && $TEST_CANONIZE == "1"
|
||||||
|
script:
|
||||||
|
- apk add --no-cache git ca-certificates >/dev/null
|
||||||
|
- export GIT_SSL_CAINFO="$CI_PROJECT_DIR/ci/lab-ca-chain.crt"
|
||||||
|
- |
|
||||||
|
if [ -z "$CANONIZE_TOKEN" ]; then
|
||||||
|
echo "FEHLT: CANONIZE_TOKEN ist im Job nicht sichtbar."
|
||||||
|
echo "Ursache meist: Variable 'protected', Pipeline laeuft aber auf einem"
|
||||||
|
echo "ungeschuetzten Branch. Genau dann bliebe die Rotation liegen."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Sichtbar: CANONIZE_TOKEN ist im Job gesetzt."
|
||||||
|
URL="https://oauth2:${CANONIZE_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git"
|
||||||
|
REF="canonize-token-probe-${CI_PIPELINE_ID}"
|
||||||
|
# Ausgabe wird gefiltert: git schreibt die URL bei Fehlern mit ins Log.
|
||||||
|
if git push "$URL" "HEAD:refs/heads/$REF" 2>&1 | sed 's#oauth2:[^@]*@#oauth2:***@#g'; then
|
||||||
|
echo "SCHREIBEN OK: Zweig $REF angelegt."
|
||||||
|
else
|
||||||
|
echo "SCHREIBEN FEHLGESCHLAGEN - Rolle oder Scope reichen nicht."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
git push "$URL" --delete "refs/heads/$REF" 2>&1 | sed 's#oauth2:[^@]*@#oauth2:***@#g' \
|
||||||
|
&& echo "Aufgeraeumt: $REF wieder entfernt." \
|
||||||
|
|| echo "WARNUNG: $REF blieb liegen, bitte von Hand loeschen."
|
||||||
|
|||||||
Reference in New Issue
Block a user