how do i update a GCP image using a CI.CD pipeline?
currently this is what i do
1. I use packer to build and customize the vmdk on my mac laptop
2. upload the vmdk to cloud bucker with gsutil
3. import the image to library:
gcloud compute images import rocky-linux9-custom-date-xxx \
--source-file=gs://xxxxxx/RockyLinux-disk001.vmdk
4. delete the old image
any idea?
Hello @gcp888 ,Welcome on Google Cloud Community.
1a. Use Packer to build and customize image as you doing this now
OR
1b. Create Packer template
2. Create Service Account for GH Actions
3. Add service account key to GH secrets
4. Push your changes to gh repo
5. Use GH and GH Actions ( I like GH Actions ) to store, trigger upload and cleanup :
6. Check your image.
PS: Of course, you need dedicated repo, GH Actions file, bucket, service account and key for that. However, if you ask any AI-like chat, it will provide for your relevant Gh Actions code.
PS2: If you plan use this workflow on production, be sure that you are not using keys but WIF for GH Actions. WIF is more secured way to allows external applications doing things behalf on service account, resides on your infra. Keys are good for testing imho.
--
cheers,
DamianS
LinkedIn medium.com Cloudskillsboost