Skip to content

Commit a6377a6

Browse files
committed
Label Hetzner image import
1 parent 1871479 commit a6377a6

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.github/workflows/image-build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,6 @@ jobs:
4747
env:
4848
HCLOUD_TOKEN: ${{ secrets.HCLOUD_TOKEN }}
4949
HCLOUD_LOCATION: nbg1
50+
IMAGE_DESCRIPTION: clawdinator-nixos
51+
IMAGE_LABELS: clawdinator=true
5052
run: scripts/import-image.sh "${IMAGE_URL}"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Image-based deploy (Option A, recommended):
5252
- `zstd dist/nixos.img -o dist/nixos.img.zst`
5353
3) Upload the image to S3 (private object; use a presigned URL for import).
5454
4) Import into Hetzner:
55-
- Use `hcloud-upload-image` (Hetzner Cloud does not support direct URL imports).
55+
- Use `hcloud-upload-image` (creates a snapshot image via a temporary server).
5656
5) Point OpenTofu at the image name or id and provision.
5757
6) Re-key agenix secrets to the new host SSH key and sync secrets to `/var/lib/clawd/nix-secrets`.
5858
7) Run `nixos-rebuild switch --flake /var/lib/clawd/repo#clawdinator-1`.

scripts/import-image.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ if [ -z "${image_url}" ]; then
88
fi
99

1010
location="${HCLOUD_LOCATION:-nbg1}"
11+
description="${IMAGE_DESCRIPTION:-clawdinator-nixos}"
12+
labels="${IMAGE_LABELS:-clawdinator=true}"
1113

1214
docker run --rm \
1315
-e HCLOUD_TOKEN="${HCLOUD_TOKEN:?HCLOUD_TOKEN required}" \
@@ -16,4 +18,6 @@ docker run --rm \
1618
--image-url "${image_url}" \
1719
--architecture x86 \
1820
--compression zstd \
19-
--location "${location}"
21+
--location "${location}" \
22+
--description "${description}" \
23+
--labels "${labels}"

0 commit comments

Comments
 (0)