fix(core-git): не терять образ раннера и не деплоить из-за пустого файла
ansible-core-mon / deploy (push) Successful in 26s
ansible-rus-central / deploy (push) Successful in 54s
ansible-core-net / deploy (push) Successful in 58s
ansible-core-secrets / deploy (push) Successful in 18s
ansible-ger-nod-02 / deploy (push) Successful in 1m18s
ansible-opnsense / deploy (push) Successful in 8s
ansible-core-mon / deploy (push) Successful in 26s
ansible-rus-central / deploy (push) Successful in 54s
ansible-core-net / deploy (push) Successful in 58s
ansible-core-secrets / deploy (push) Successful in 18s
ansible-ger-nod-02 / deploy (push) Successful in 1m18s
ansible-opnsense / deploy (push) Successful in 8s
Архив homelab-ansible хранится на диске CT, проверка раннера вынесена в отдельную кнопку, cAdvisor смотрит свой порт. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
db92435117
commit
321c78fc27
10 files changed
+89
-7
No files matched your search
@@ -72,5 +72,6 @@ services:
|
||||
- gitea
|
||||
volumes:
|
||||
- {{ gitea_dir }}/runner-data:/data
|
||||
- {{ gitea_dir }}/images:/images:ro
|
||||
- runner-docker:/var/lib/docker
|
||||
{% endif %}
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
# Образ homelab-ansible есть только на этой машине. Архив лежит на диске CT,
|
||||
# не внутри volume DinD: очистка volume его не стирает.
|
||||
set -euo pipefail
|
||||
|
||||
archive="{{ gitea_dir }}/images/homelab-ansible.tar"
|
||||
container_archive="/images/homelab-ansible.tar"
|
||||
|
||||
if docker exec gitea-runner docker image inspect homelab-ansible:latest >/dev/null 2>&1; then
|
||||
if [ ! -s "$archive" ]; then
|
||||
mkdir -p "{{ gitea_dir }}/images"
|
||||
docker exec gitea-runner docker save homelab-ansible:latest > "$archive"
|
||||
chmod 600 "$archive"
|
||||
echo "saved ${archive}"
|
||||
else
|
||||
echo "present"
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -s "$archive" ]; then
|
||||
docker exec gitea-runner docker load -i "$container_archive"
|
||||
echo "loaded"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Образ homelab-ansible:latest не найден ни в раннере, ни в ${archive}" >&2
|
||||
exit 1
|
||||
Reference in new issue
Block a user