diff options
| author | Shulhan <ms@kilabit.info> | 2025-12-25 19:39:54 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2025-12-26 13:57:05 +0700 |
| commit | 058f6729af0dc2f9a367a268e2d387a9f922406e (patch) | |
| tree | 51d590399cd2439208300a68e8311bc37c497f31 /gcloud-image-publish.aww | |
| parent | fca620c1e13bae91b4a3167a10d660f3d72e7aeb (diff) | |
| download | compute-archlinux-image-builder-058f6729af0dc2f9a367a268e2d387a9f922406e.tar.xz | |
all: create the images under project name kilabit
We are currently cleaning up my GCP account, so we unify some projects
into one.
The arch-builder now moved under kilabit project.
Diffstat (limited to 'gcloud-image-publish.aww')
| -rw-r--r-- | gcloud-image-publish.aww | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/gcloud-image-publish.aww b/gcloud-image-publish.aww index 9a3d5f0..e34108e 100644 --- a/gcloud-image-publish.aww +++ b/gcloud-image-publish.aww @@ -1,39 +1,36 @@ ## Script to publish builded image to public. -#require: gcloud config configurations activate {{.Val "gcloud::config"}} +#require: gcloud config configurations activate {{.Val "gcloud:arch-builder:config"}} -gcloud storage cp {{.Val "host::image"}}.tar.gz gs://arch-builder-a/image/{{.Val "host::image"}}.tar.gz +gcloud storage cp {{.Val "host::image"}}.tar.gz \ + gs://{{.Val "gcloud:arch-builder:storage"}}/image/{{.Val "host::image"}}.tar.gz -gcloud compute images delete {{.Val "host::image"}} --project={{.Val "gcloud::project"}} --quiet || exit 0 +gcloud compute images delete {{.Val "host::image"}} \ + --project={{.Val "gcloud:arch-builder:project"}} --quiet \ + || exit 0 gcloud compute images create {{.Val "host::image"}} \ - --project={{.Val "gcloud::project"}} \ - --source-uri=gs://arch-builder-a/image/{{.Val "host::image"}}.tar.gz \ + --project={{.Val "gcloud:arch-builder:project"}} \ + --source-uri=gs://{{.Val "gcloud:arch-builder:storage"}}/image/{{.Val "host::image"}}.tar.gz \ + --storage-location=asia \ --family=arch \ --guest-os-features=GVNIC,UEFI_COMPATIBLE,VIRTIO_SCSI_MULTIQUEUE \ --description="Arch linux image with ops-agent. See https://github.com/shuLhan/compute-archlinux-image-builder" -gcloud compute images deprecate {{.Val "host::image"}} \ - --project={{.Val "gcloud::project"}} \ - --state=ACTIVE \ - --deprecate-in=30d \ - --obsolete-in=37d \ - --delete-in=44d - gcloud compute images list --no-standard-images \ - --project={{.Val "gcloud::project"}} + --project={{.Val "gcloud:arch-builder:project"}} gcloud compute images describe {{.Val "host::image"}} \ - --project={{.Val "gcloud::project"}} + --project={{.Val "gcloud:arch-builder:project"}} ## Share the image publicly with authenticated users. gcloud compute images add-iam-policy-binding {{.Val "host::image"}} \ - --project={{.Val "gcloud::project"}} \ - --member='allAuthenticatedUsers' \ - --role='roles/compute.imageUser' + --project={{.Val "gcloud:arch-builder:project"}} \ + --member='allAuthenticatedUsers' \ + --role='roles/compute.imageUser' ## Delete the image on storage. -gcloud storage rm --all-versions gs://arch-builder-a/image/** -gcloud storage ls gs://arch-builder-a/ +gcloud storage rm --all-versions gs://{{.Val "gcloud:arch-builder:storage"}}/image/** +gcloud storage ls gs://{{.Val "gcloud:arch-builder:storage"}}/ |
