Skip to content

Commit fe1eb58

Browse files
authored
refactor: Use and copy set of cloud build configs & update READMEs (#25)
1 parent fe84810 commit fe1eb58

File tree

9 files changed

+14
-189
lines changed

9 files changed

+14
-189
lines changed

1-org/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ The purpose of this step is to setup top level shared folders, monitoring & netw
1212
1. Clone repo `gcloud source repos clone gcp-org --project=YOUR_CLOUD_BUILD_PROJECT_ID (this is from `terraform output` from the previous section, 0-bootstrap)`
1313
1. Navigate into the repo `cd gcp-org` and change to a non master branch `git checkout -b plan`
1414
1. Copy contents of foundation to new repo `cp -R ../terraform-example-foundation/1-org/* .` (modify accordingly based on your current directory)
15+
1. Copy cloud build configuration files for terraform `cp ../terraform-example-foundation/build/cloudbuild-tf-* . ` (modify accordingly based on your current directory)
1516
1. Rename terraform.example.tfvars to terraform.tfvars and update the file with values from your environment and bootstrap (you can re-run `terraform output` in the 0-bootstrap directory to find these values).
1617
1. Rename backend.tf.example backend.tf and update with your bucket from bootstrap.
1718
1. Commit changes with `git add .` and `git commit -m 'Your message'`

1-org/cloudbuild-tf-apply.yaml

Lines changed: 0 additions & 48 deletions
This file was deleted.

1-org/cloudbuild-tf-plan.yaml

Lines changed: 0 additions & 41 deletions
This file was deleted.

2-networks/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ The purpose of this step is to setup shared VPCs with default DNS, NAT, Private
1212
### Setup to run via Cloud Build
1313
1. Clone repo `gcloud source repos clone gcp-networks --project=YOUR_CLOUD_BUILD_PROJECT_ID`
1414
1. Change freshly cloned repo and change to non master branch `git checkout -b plan`
15-
1. Copy contents of foundation to new repo `cp ../terraform-example-foundation/2-networks/* .`
15+
1. Copy contents of foundation to new repo `cp -R ../terraform-example-foundation/2-networks/* .` (modify accordingly based on your current directory)
16+
1. Copy cloud build configuration files for terraform `cp ../terraform-example-foundation/build/cloudbuild-tf-* . ` (modify accordingly based on your current directory)
1617
1. Rename terraform.example.tfvars to terraform.tfvars and update the file with values from your environment and bootstrap.
1718
1. Rename backend.tf.example backend.tf and update with your bucket from bootstrap.
1819
1. Commit changes with `git add .` and `git commit -m 'Your message'`

2-networks/cloudbuild-tf-apply.yaml

Lines changed: 0 additions & 48 deletions
This file was deleted.

2-networks/cloudbuild-tf-plan.yaml

Lines changed: 0 additions & 41 deletions
This file was deleted.

3-projects/README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,26 @@ The purpose of this step is to setup folder structure and projects for applicati
1010

1111
## Usage
1212
### Setup to run via Cloud Build
13-
1. Clone repo gcloud source repos clone gcp-projects --project=YOUR_CLOUD_BUILD_PROJECT_ID
14-
1. Change freshly cloned repo and change to non master branch git checkout -b plan
15-
1. Copy contents of foundation to new repo cp ../terraform-example-foundation/3-projects/* .
13+
1. Clone repo `gcloud source repos clone gcp-projects --project=YOUR_CLOUD_BUILD_PROJECT_ID`
14+
1. Change freshly cloned repo and change to non master branch `git checkout -b plan`
15+
1. Copy contents of foundation to new repo `cp -R ../terraform-example-foundation/3-projects/* .` (modify accordingly based on your current directory)
16+
1. Copy cloud build configuration files for terraform `cp ../terraform-example-foundation/build/cloudbuild-tf-* . ` (modify accordingly based on your current directory)
1617
1. Rename terraform.example.tfvars to terraform.tfvars and update the file with values from your environment and bootstrap.
1718
1. Rename backend.tf.example backend.tf and update with your bucket from bootstrap.
18-
1. Commit changes with git add . and git commit -m 'Your message'
19-
1. Push your non master branch to trigger a plan git push --set-upstream origin plan
19+
1. Commit changes with `git add .` and `git commit -m 'Your message'`
20+
1. Push your non master branch to trigger a plan `git push --set-upstream origin plan`
2021
1. Review the plan output in your cloud build project https://console.cloud.google.com/cloud-build/builds?project=YOUR_CLOUD_BUILD_PROJECT_ID
21-
1. Merge changes to master with git checkout -b master and git push origin master
22-
1.Review the apply output in your cloud build project https://console.cloud.google.com/cloud-build/builds?project=YOUR_CLOUD_BUILD_PROJECT_ID
22+
1. Merge changes to master with `git checkout -b master` and `git push origin master`
23+
1. Review the apply output in your cloud build project https://console.cloud.google.com/cloud-build/builds?project=YOUR_CLOUD_BUILD_PROJECT_ID
2324

2425

2526
### Run terraform locally
2627
1. Change into 3-projects folder
2728
1. Rename terraform.example.tfvars to terraform.tfvars and update the file with values from your environment and bootstrap.
2829
1. Rename backend.tf.example backend.tf and update with your bucket from bootstrap.
29-
1. Run terraform init
30-
1. Run terraform plan and review output
31-
1. Run terraform apply
30+
1. Run `terraform init`
31+
1. Run `terraform plan` and review output
32+
1. Run `terraform apply`
3233

3334
### Subnetting Module (Optional)
3435
Creates a dedicated subnet per environment, per project and applies org policy to restrict access to only this subnet. Refer to the README [here](./modules/project_subnet/README.md) for details about this module.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)