All checks were successful
CICD Start / Sanity and Base Decision (pull_request) Successful in 1m32s
Signed-off-by: copilotcoder <copilotcoder@darkhelm.org>
43 lines
1.6 KiB
Plaintext
43 lines
1.6 KiB
Plaintext
hosts = [
|
|
"kankali.darkhelm.lan",
|
|
"zhokq.darkhelm.lan",
|
|
"urtzul.darkhelm.lan",
|
|
"pi-desktop.darkhelm.lan",
|
|
]
|
|
|
|
# Pull upstream tag, retag/push to local registry mirror, verify mirror tag.
|
|
remote_code = """
|
|
$(docker pull ubuntu:22.04)
|
|
$(docker pull ghcr.io/catthehacker/ubuntu:act-latest)
|
|
$(docker tag ghcr.io/catthehacker/ubuntu:act-latest kankali.darkhelm.lan:3001/darkhelm.org/act-ubuntu:act-latest)
|
|
|
|
push = !(docker push kankali.darkhelm.lan:3001/darkhelm.org/act-ubuntu:act-latest > /tmp/mirror-push.log 2>&1)
|
|
if push.returncode == 0:
|
|
print("MIRROR_PUSH:ok")
|
|
else:
|
|
mismatch = !(grep -qi "http response to https client" /tmp/mirror-push.log)
|
|
print("MIRROR_PUSH:https-mismatch" if mismatch.returncode == 0 else "MIRROR_PUSH:failed")
|
|
|
|
# Validate that the mirror is actually pullable from this host's Docker configuration.
|
|
$(docker image rm kankali.darkhelm.lan:3001/darkhelm.org/act-ubuntu:act-latest > /dev/null 2> /dev/null || true)
|
|
pull = !(docker pull kankali.darkhelm.lan:3001/darkhelm.org/act-ubuntu:act-latest > /tmp/mirror-verify.log 2>&1)
|
|
if pull.returncode == 0:
|
|
print("MIRROR_PULL:ok")
|
|
else:
|
|
mismatch = !(grep -qi "http response to https client" /tmp/mirror-verify.log)
|
|
print("MIRROR_PULL:https-mismatch" if mismatch.returncode == 0 else "MIRROR_PULL:failed")
|
|
|
|
if $(docker image inspect ubuntu:22.04):
|
|
print("UBUNTU22_PRESENT")
|
|
else:
|
|
print("UBUNTU22_MISSING")
|
|
if $(docker image inspect kankali.darkhelm.lan:3001/darkhelm.org/act-ubuntu:act-latest):
|
|
print("MIRROR_PRESENT")
|
|
else:
|
|
print("MIRROR_MISSING")
|
|
"""
|
|
|
|
for host in hosts:
|
|
print(f"\n=== {host} ===")
|
|
ssh @(host) @(remote_code)
|