diff options
| author | Shulhan <ms@kilabit.info> | 2023-09-12 15:26:48 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2023-09-12 15:26:48 +0700 |
| commit | 4f618008ba2f13d1c53c352a58ececc22e01b614 (patch) | |
| tree | 86a96753869db0246be9f89ddfc7593af8c3d5f1 /gcloud-image-publish.aww | |
| parent | f1fac86edd64455562f2d1744b6f3d670e8ef09d (diff) | |
| download | compute-archlinux-image-builder-4f618008ba2f13d1c53c352a58ececc22e01b614.tar.xz | |
all: define the project name when executing gcloud
In environment where user have multiple projects, there is a possibility
that running gcloud command, even after we set
gcloud config configurations activate <config>
will run not in the project arch-builder but in other project.
Diffstat (limited to 'gcloud-image-publish.aww')
| -rw-r--r-- | gcloud-image-publish.aww | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gcloud-image-publish.aww b/gcloud-image-publish.aww index c238673..03d1075 100644 --- a/gcloud-image-publish.aww +++ b/gcloud-image-publish.aww @@ -4,26 +4,32 @@ gsutil cp {{.Val "host::image"}}.tar.gz gs://arch-builder-a/image/ -gcloud compute images delete {{.Val "host::image"}} --quiet || exit 0 +gcloud compute images delete {{.Val "host::image"}} --project={{.Val "gcloud::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 \ --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 -gcloud compute images describe {{.Val "host::image"}} +gcloud compute images list --no-standard-images \ + --project={{.Val "gcloud::project"}} + +gcloud compute images describe {{.Val "host::image"}} \ + --project={{.Val "gcloud::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' |
