chore(infra): Gitea-Host auf git.hg-int.dev umstellen
Gitea läuft seit 2026-11-11 auf hivegrid-control (git.hg-int.dev); git.tool-ctrl.de wird abgeschaltet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c4701e5b37
commit
d09f79b673
56 files changed
+138
-138
No files matched your search
+26
-26
@@ -41,7 +41,7 @@ jobs:
|
||||
stage-or-promote:
|
||||
runs-on: toolctrl-deploy
|
||||
env:
|
||||
REGISTRY: git.tool-ctrl.de
|
||||
REGISTRY: git.hg-int.dev
|
||||
IMAGE_NAMESPACE: toolctrl-labs
|
||||
IMAGE_PREFIX: hivegrid
|
||||
DEPLOY_BUILDER_NAME: hivegrid-deploy-v0312-gc1
|
||||
@@ -82,7 +82,7 @@ jobs:
|
||||
echo "HIVEGRID_GITEA_HOST_IP must be a single IPv4 or IPv6 token"
|
||||
exit 1
|
||||
fi
|
||||
printf '%s git.tool-ctrl.de\\n' "$HIVEGRID_GITEA_HOST_IP" >> /etc/hosts
|
||||
printf '%s git.hg-int.dev\\n' "$HIVEGRID_GITEA_HOST_IP" >> /etc/hosts
|
||||
fi
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
@@ -180,7 +180,7 @@ jobs:
|
||||
sh -eu <<'HIVEGRID_BUILDKIT_HOST_OVERRIDE'
|
||||
HOSTS_TMP="$(mktemp)"
|
||||
trap 'rm -f "$HOSTS_TMP"' EXIT HUP INT TERM
|
||||
awk -v host="git.tool-ctrl.de" '
|
||||
awk -v host="git.hg-int.dev" '
|
||||
{
|
||||
rewritten = ""
|
||||
for (field = 1; field <= NF; field += 1) {
|
||||
@@ -195,9 +195,9 @@ jobs:
|
||||
}
|
||||
' /etc/hosts > "$HOSTS_TMP"
|
||||
cat "$HOSTS_TMP" > /etc/hosts
|
||||
printf '%s git.tool-ctrl.de\\n' "$HIVEGRID_GITEA_HOST_IP" >> /etc/hosts
|
||||
BUILDKIT_HOST_COUNT="$(awk -v host="git.tool-ctrl.de" '{ for (field = 2; field <= NF; field += 1) if ($field == host) count += 1 } END { print count + 0 }' /etc/hosts)"
|
||||
BUILDKIT_EXACT_HOST_COUNT="$(awk -v host="git.tool-ctrl.de" -v ip="$HIVEGRID_GITEA_HOST_IP" '$1 == ip { for (field = 2; field <= NF; field += 1) if ($field == host) count += 1 } END { print count + 0 }' /etc/hosts)"
|
||||
printf '%s git.hg-int.dev\\n' "$HIVEGRID_GITEA_HOST_IP" >> /etc/hosts
|
||||
BUILDKIT_HOST_COUNT="$(awk -v host="git.hg-int.dev" '{ for (field = 2; field <= NF; field += 1) if ($field == host) count += 1 } END { print count + 0 }' /etc/hosts)"
|
||||
BUILDKIT_EXACT_HOST_COUNT="$(awk -v host="git.hg-int.dev" -v ip="$HIVEGRID_GITEA_HOST_IP" '$1 == ip { for (field = 2; field <= NF; field += 1) if ($field == host) count += 1 } END { print count + 0 }' /etc/hosts)"
|
||||
if [ "$BUILDKIT_HOST_COUNT" -ne 1 ] || [ "$BUILDKIT_EXACT_HOST_COUNT" -ne 1 ]; then
|
||||
echo "BuildKit registry host override did not converge to exactly one validated mapping"
|
||||
exit 1
|
||||
@@ -2248,21 +2248,21 @@ describe("verify-gitea-deploy-workflow", () => {
|
||||
);
|
||||
const result = verifyGiteaDeployWorkflow(createFixture(unsafeWorkflow));
|
||||
|
||||
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.tool-ctrl\.de mapping/);
|
||||
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.hg-int\.dev mapping/);
|
||||
});
|
||||
|
||||
it("fails when isolated BuildKit appends without replacing a stale registry host mapping", () => {
|
||||
const unsafeWorkflow = VALID_WORKFLOW.replace('cat "$HOSTS_TMP" > /etc/hosts', 'cat "$HOSTS_TMP" > /tmp/unapplied-hosts');
|
||||
const result = verifyGiteaDeployWorkflow(createFixture(unsafeWorkflow));
|
||||
|
||||
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.tool-ctrl\.de mapping/);
|
||||
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.hg-int\.dev mapping/);
|
||||
});
|
||||
|
||||
it("fails when isolated BuildKit accepts a stale mapping beside the exact registry host mapping", () => {
|
||||
const unsafeWorkflow = VALID_WORKFLOW.replace('"$BUILDKIT_HOST_COUNT" -ne 1', '"$BUILDKIT_HOST_COUNT" -lt 1');
|
||||
const result = verifyGiteaDeployWorkflow(createFixture(unsafeWorkflow));
|
||||
|
||||
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.tool-ctrl\.de mapping/);
|
||||
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.hg-int\.dev mapping/);
|
||||
});
|
||||
|
||||
it("fails when isolated BuildKit no longer removes stale registry host tokens", () => {
|
||||
@@ -2272,14 +2272,14 @@ describe("verify-gitea-deploy-workflow", () => {
|
||||
);
|
||||
const result = verifyGiteaDeployWorkflow(createFixture(unsafeWorkflow));
|
||||
|
||||
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.tool-ctrl\.de mapping/);
|
||||
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.hg-int\.dev mapping/);
|
||||
});
|
||||
|
||||
it("fails when isolated BuildKit no longer resets the rewritten hosts line per record", () => {
|
||||
const unsafeWorkflow = VALID_WORKFLOW.replace(' rewritten = ""\n for (field', " for (field");
|
||||
const result = verifyGiteaDeployWorkflow(createFixture(unsafeWorkflow));
|
||||
|
||||
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.tool-ctrl\.de mapping/);
|
||||
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.hg-int\.dev mapping/);
|
||||
});
|
||||
|
||||
it("fails when isolated BuildKit moves the rewritten hosts reset outside the record block", () => {
|
||||
@@ -2289,17 +2289,17 @@ describe("verify-gitea-deploy-workflow", () => {
|
||||
);
|
||||
const result = verifyGiteaDeployWorkflow(createFixture(unsafeWorkflow));
|
||||
|
||||
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.tool-ctrl\.de mapping/);
|
||||
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.hg-int\.dev mapping/);
|
||||
});
|
||||
|
||||
it("fails when isolated BuildKit moves the entire hosts rewrite into an AWK BEGIN block", () => {
|
||||
const unsafeWorkflow = VALID_WORKFLOW.replace(
|
||||
' awk -v host="git.tool-ctrl.de" \'\n {',
|
||||
' awk -v host="git.tool-ctrl.de" \'\n BEGIN {'
|
||||
' awk -v host="git.hg-int.dev" \'\n {',
|
||||
' awk -v host="git.hg-int.dev" \'\n BEGIN {'
|
||||
);
|
||||
const result = verifyGiteaDeployWorkflow(createFixture(unsafeWorkflow));
|
||||
|
||||
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.tool-ctrl\.de mapping/);
|
||||
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.hg-int\.dev mapping/);
|
||||
});
|
||||
|
||||
it("fails when isolated BuildKit hard-codes a passing registry host count", () => {
|
||||
@@ -2309,24 +2309,24 @@ describe("verify-gitea-deploy-workflow", () => {
|
||||
);
|
||||
const result = verifyGiteaDeployWorkflow(createFixture(unsafeWorkflow));
|
||||
|
||||
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.tool-ctrl\.de mapping/);
|
||||
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.hg-int\.dev mapping/);
|
||||
});
|
||||
|
||||
it("fails when isolated BuildKit counts a different hostname", () => {
|
||||
const unsafeWorkflow = VALID_WORKFLOW.replace(
|
||||
'BUILDKIT_HOST_COUNT="$(awk -v host="git.tool-ctrl.de"',
|
||||
'BUILDKIT_HOST_COUNT="$(awk -v host="git.hg-int.dev"',
|
||||
'BUILDKIT_HOST_COUNT="$(awk -v host="localhost"'
|
||||
);
|
||||
const result = verifyGiteaDeployWorkflow(createFixture(unsafeWorkflow));
|
||||
|
||||
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.tool-ctrl\.de mapping/);
|
||||
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.hg-int\.dev mapping/);
|
||||
});
|
||||
|
||||
it("fails when isolated BuildKit drops the validated-IP predicate", () => {
|
||||
const unsafeWorkflow = VALID_WORKFLOW.replace("'$1 == ip { for (field", "'1 == 1 { for (field");
|
||||
const result = verifyGiteaDeployWorkflow(createFixture(unsafeWorkflow));
|
||||
|
||||
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.tool-ctrl\.de mapping/);
|
||||
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.hg-int\.dev mapping/);
|
||||
});
|
||||
|
||||
it("fails when isolated BuildKit validates the IP only after writing its hosts file", () => {
|
||||
@@ -2339,7 +2339,7 @@ describe("verify-gitea-deploy-workflow", () => {
|
||||
assert.notEqual(validationIndex, -1);
|
||||
const withoutValidation =
|
||||
VALID_WORKFLOW.slice(0, validationIndex) + VALID_WORKFLOW.slice(validationIndex + validationBlock.length);
|
||||
const builderAppend = ` printf '%s git.tool-ctrl.de\\n' "$HIVEGRID_GITEA_HOST_IP" >> /etc/hosts
|
||||
const builderAppend = ` printf '%s git.hg-int.dev\\n' "$HIVEGRID_GITEA_HOST_IP" >> /etc/hosts
|
||||
`;
|
||||
const appendIndex = withoutValidation.lastIndexOf(builderAppend);
|
||||
assert.notEqual(appendIndex, -1);
|
||||
@@ -2348,7 +2348,7 @@ describe("verify-gitea-deploy-workflow", () => {
|
||||
withoutValidation.slice(0, insertIndex) + validationBlock + withoutValidation.slice(insertIndex);
|
||||
const result = verifyGiteaDeployWorkflow(createFixture(unsafeWorkflow));
|
||||
|
||||
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.tool-ctrl\.de mapping/);
|
||||
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.hg-int\.dev mapping/);
|
||||
});
|
||||
|
||||
it("fails when the missing BuildKit host override guard is pass-open", () => {
|
||||
@@ -2358,7 +2358,7 @@ describe("verify-gitea-deploy-workflow", () => {
|
||||
);
|
||||
const result = verifyGiteaDeployWorkflow(createFixture(unsafeWorkflow));
|
||||
|
||||
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.tool-ctrl\.de mapping/);
|
||||
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.hg-int\.dev mapping/);
|
||||
});
|
||||
|
||||
it("fails when the invalid BuildKit host override guard is pass-open", () => {
|
||||
@@ -2368,7 +2368,7 @@ describe("verify-gitea-deploy-workflow", () => {
|
||||
);
|
||||
const result = verifyGiteaDeployWorkflow(createFixture(unsafeWorkflow));
|
||||
|
||||
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.tool-ctrl\.de mapping/);
|
||||
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.hg-int\.dev mapping/);
|
||||
});
|
||||
|
||||
it("fails when the BuildKit host count mismatch guard is pass-open", () => {
|
||||
@@ -2378,7 +2378,7 @@ describe("verify-gitea-deploy-workflow", () => {
|
||||
);
|
||||
const result = verifyGiteaDeployWorkflow(createFixture(unsafeWorkflow));
|
||||
|
||||
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.tool-ctrl\.de mapping/);
|
||||
assert.match(result.failures.join("\n"), /must require, validate, replace, and verify exactly one git\.hg-int\.dev mapping/);
|
||||
});
|
||||
|
||||
it("fails when isolated deploy BuildKit shutdown is not always-run", () => {
|
||||
@@ -3057,7 +3057,7 @@ describe("verify-gitea-deploy-workflow", () => {
|
||||
assert.notEqual(validationIndex, -1);
|
||||
const withoutValidation =
|
||||
VALID_WORKFLOW.slice(0, validationIndex) + VALID_WORKFLOW.slice(validationIndex + validationBlock.length);
|
||||
const runnerAppend = ` printf '%s git.tool-ctrl.de\\n' "$HIVEGRID_GITEA_HOST_IP" >> /etc/hosts
|
||||
const runnerAppend = ` printf '%s git.hg-int.dev\\n' "$HIVEGRID_GITEA_HOST_IP" >> /etc/hosts
|
||||
`;
|
||||
const appendIndex = withoutValidation.indexOf(runnerAppend);
|
||||
assert.notEqual(appendIndex, -1);
|
||||
@@ -3072,7 +3072,7 @@ describe("verify-gitea-deploy-workflow", () => {
|
||||
it("fails when the internal host override is written without token validation", () => {
|
||||
const result = verifyGiteaDeployWorkflow(
|
||||
createFixture(
|
||||
`${VALID_WORKFLOW}\n host-smoke:\n runs-on: toolctrl-deploy\n steps:\n - name: Resolve internal host\n run: |\n if [ -n \"\${HIVEGRID_GITEA_HOST_IP:-}\" ]; then\n printf '%s git.tool-ctrl.de\\n' \"$HIVEGRID_GITEA_HOST_IP\" >> /etc/hosts\n fi\n`
|
||||
`${VALID_WORKFLOW}\n host-smoke:\n runs-on: toolctrl-deploy\n steps:\n - name: Resolve internal host\n run: |\n if [ -n \"\${HIVEGRID_GITEA_HOST_IP:-}\" ]; then\n printf '%s git.hg-int.dev\\n' \"$HIVEGRID_GITEA_HOST_IP\" >> /etc/hosts\n fi\n`
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
Reference in new issue
Block a user