Fix authentication for podman being gone after VM reboot

This commit is contained in:
Lilian 2025-11-01 19:55:50 +01:00
parent f174b9702a
commit f6fb39388e
2 changed files with 6 additions and 6 deletions

2
.gitignore vendored
View file

@ -1,2 +1,4 @@
# forgejo actions runner registration token # forgejo actions runner registration token
.runner* .runner*
# podman authentication
podman-auth.json

View file

@ -1,9 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
BASEDIR=/etc/forgejo-actions BASEDIR=/etc/forgejo-actions
AUTH_FILE=/etc/forgejo-actions/podman-auth.json
echo "using key file: ${XDG_RUNTIME_DIR}/containers/auth.json"
podman login --get-login git.ctbk.de
# extra container tags and pushes for things that we dont build, but need # extra container tags and pushes for things that we dont build, but need
podman pull data.forgejo.org/oci/alpine:latest podman pull data.forgejo.org/oci/alpine:latest
@ -12,13 +10,13 @@ podman pull ghcr.io/catthehacker/ubuntu:act-24.04
podman tag data.forgejo.org/oci/alpine:latest git.ctbk.de/infra/alpine:latest podman tag data.forgejo.org/oci/alpine:latest git.ctbk.de/infra/alpine:latest
podman tag ghcr.io/catthehacker/ubuntu:act-24.04 git.ctbk.de/infra/ubuntu:act-24.04 podman tag ghcr.io/catthehacker/ubuntu:act-24.04 git.ctbk.de/infra/ubuntu:act-24.04
podman push git.ctbk.de/infra/alpine:latest podman push --authfile /etc/forgejo-actions/podman-auth.json git.ctbk.de/infra/alpine:latest
podman push git.ctbk.de/infra/ubuntu:act-24.04 podman push --authfile /etc/forgejo-actions/podman-auth.json git.ctbk.de/infra/ubuntu:act-24.04
for container in "$BASEDIR"/Containerfile.*; do for container in "$BASEDIR"/Containerfile.*; do
base=$(basename "$container") base=$(basename "$container")
tag=${base#"Containerfile."} tag=${base#"Containerfile."}
podman build -t "git.ctbk.de/infra/$tag" --cpu-quota 50000 -f "$container" $BASEDIR podman build -t "git.ctbk.de/infra/$tag" --cpu-quota 50000 -f "$container" $BASEDIR
podman push "git.ctbk.de/infra/$tag" podman --authfile /etc/forgejo-actions/podman-auth.json push "git.ctbk.de/infra/$tag"
done done