https://github.com/syntapy/gce_img_builder
Build GCE images on GCP using Terraform, Packer, and Cloud Build
https://github.com/syntapy/gce_img_builder
google-cloud-build google-cloud-platform packer terraform
Last synced: about 1 year ago
JSON representation
Build GCE images on GCP using Terraform, Packer, and Cloud Build
- Host: GitHub
- URL: https://github.com/syntapy/gce_img_builder
- Owner: syntapy
- Created: 2021-07-25T05:49:23.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-09-11T04:00:04.000Z (almost 5 years ago)
- Last Synced: 2025-02-08T06:14:05.490Z (over 1 year ago)
- Topics: google-cloud-build, google-cloud-platform, packer, terraform
- Language: HCL
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Overview
========
Automated GCE image build pipeline with Google Cloud Build triggers using Terraform and Packer
There are two source repos to be hosted on Google Cloud Repository:
- Packer image builder in `repos/packer` to allow running packer in cloud build
- The GCE image builder in `repos/machine_image` which uses packer
The terraform configs will also creates the Google Cloud project as well
To Run
======
Needs an organization level account (google workspace account) and works with the following roles assigned to the account terraform uses (`gcloud auth application-default login`)
- roles/billing.creator
- roles/resourcemanager.organizationAdmin
- roles/resourcemanager.projectCreator
- roles/storage.admin
You may need to run `terraform apply` twice, since I think a service acount gets created on first run for a project
You will get the output URLs for the two google source repositories. These are labeled:
- `packer_build_repo`
- `machine_image_repo`
Then cd into `repos/packer/` and run `git add remote google ` and push
A build should be triggered as indicated by `gcloud builds list`
Once thats done go into `repos/machine_image` and run `git add remote google