Skip to content

Update readme files #399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update instructions in 2-environments READMEs
  • Loading branch information
daniel-cit committed Apr 1, 2021
commit 09237062b53d162a0cdd48c5318ffe174bc57939
6 changes: 3 additions & 3 deletions 2-environments/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ The purpose of this step is to set up development, non-production and production

### Setup to run via Cloud Build
1. Clone repo `gcloud source repos clone gcp-environments --project=YOUR_CLOUD_BUILD_PROJECT_ID`.
1. Change freshly cloned repo and change to non master branch `git checkout -b plan`.
1. Navigate into the repo `cd gcp-environments` and change to non master branch `git checkout -b plan`.
1. Copy contents of foundation to new repo `cp -RT ../terraform-example-foundation/2-environments/ .` (modify accordingly based on your current directory).
1. Copy cloud build configuration files for terraform `cp ../terraform-example-foundation/build/cloudbuild-tf-* . ` (modify accordingly based on your current directory).
1. Copy terraform wrapper script `cp ../terraform-example-foundation/build/tf-wrapper.sh . ` to the root of your new repository (modify accordingly based on your current directory).
1. Ensure wrapper script can be executed `chmod 755 ./tf-wrapper.sh`.
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).
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). See any of the environment folder [README.md](./envs/production/README.md) files for additional information on the values in the `terraform.tfvars` file.
1. Commit changes with `git add .` and `git commit -m 'Your message'`.
1. Push your plan branch to trigger a plan for all environments `git push --set-upstream origin plan` (the branch `plan` is not a special one. Any branch which name is different from `development`, `non-production` or `production` will trigger a terraform plan).
1. Review the plan output in your cloud build project https://console.cloud.google.com/cloud-build/builds?project=YOUR_CLOUD_BUILD_PROJECT_ID
Expand All @@ -42,7 +42,7 @@ The purpose of this step is to set up development, non-production and production
```
1. Copy terraform wrapper script `cp ../terraform-example-foundation/build/tf-wrapper.sh . ` to the root of your new repository (modify accordingly based on your current directory).
1. Ensure wrapper script can be executed `chmod 755 ./tf-wrapper.sh`.
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).
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). See any of the environment folder [README.md](./envs/production/README.md) files for additional information on the values in the `terraform.tfvars` file.
1. Commit changes with `git add .` and `git commit -m 'Your message'`.
1. Push your plan branch `git push --set-upstream origin plan`. The branch `plan` is not a special one. Any branch which name is different from `development`, `non-production` or `production` will trigger a terraform plan.
- Assuming you configured an automatic trigger in your Jenkins Master (see [Jenkins sub-module README](../0-bootstrap/modules/jenkins-agent)), this will trigger a plan. You can also trigger a Jenkins job manually. Given the many options to do this in Jenkins, it is out of the scope of this document see [Jenkins website](http://www.jenkins.io) for more details.
Expand Down
6 changes: 3 additions & 3 deletions 2-environments/envs/development/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@

| Name | Description |
|------|-------------|
| base\_shared\_vpc\_project\_id | Project for monitoring infra. |
| base\_shared\_vpc\_project\_id | Project for base shared VPC. |
| env\_folder | Environment folder created under parent. |
| env\_secrets\_project\_id | Project for monitoring infra. |
| env\_secrets\_project\_id | Project for environment related secrets. |
| monitoring\_project\_id | Project for monitoring infra. |
| restricted\_shared\_vpc\_project\_id | Project for monitoring infra. |
| restricted\_shared\_vpc\_project\_id | Project for restricted shared VPC. |

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
6 changes: 3 additions & 3 deletions 2-environments/envs/development/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ output "monitoring_project_id" {
}

output "base_shared_vpc_project_id" {
description = "Project for monitoring infra."
description = "Project for base shared VPC."
value = module.env.base_shared_vpc_project_id
}

output "restricted_shared_vpc_project_id" {
description = "Project for monitoring infra."
description = "Project for restricted shared VPC."
value = module.env.restricted_shared_vpc_project_id
}

output "env_secrets_project_id" {
description = "Project for monitoring infra."
description = "Project for environment related secrets."
value = module.env.env_secrets_project_id
}
6 changes: 3 additions & 3 deletions 2-environments/envs/non-production/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@

| Name | Description |
|------|-------------|
| base\_shared\_vpc\_project\_id | Project for monitoring infra. |
| base\_shared\_vpc\_project\_id | Project for base shared VPC. |
| env\_folder | Environment folder created under parent. |
| env\_secrets\_project\_id | Project for monitoring infra. |
| env\_secrets\_project\_id | Project for environment related secrets. |
| monitoring\_project\_id | Project for monitoring infra. |
| restricted\_shared\_vpc\_project\_id | Project for monitoring infra. |
| restricted\_shared\_vpc\_project\_id | Project for restricted shared VPC. |

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
6 changes: 3 additions & 3 deletions 2-environments/envs/non-production/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ output "monitoring_project_id" {
}

output "base_shared_vpc_project_id" {
description = "Project for monitoring infra."
description = "Project for base shared VPC."
value = module.env.base_shared_vpc_project_id
}

output "restricted_shared_vpc_project_id" {
description = "Project for monitoring infra."
description = "Project for restricted shared VPC."
value = module.env.restricted_shared_vpc_project_id
}

output "env_secrets_project_id" {
description = "Project for monitoring infra."
description = "Project for environment related secrets."
value = module.env.env_secrets_project_id
}
6 changes: 3 additions & 3 deletions 2-environments/envs/production/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@

| Name | Description |
|------|-------------|
| base\_shared\_vpc\_project\_id | Project for monitoring infra. |
| base\_shared\_vpc\_project\_id | Project for base shared VPC. |
| env\_folder | Environment folder created under parent. |
| env\_secrets\_project\_id | Project for monitoring infra. |
| env\_secrets\_project\_id | Project for environment related secrets. |
| monitoring\_project\_id | Project for monitoring infra. |
| restricted\_shared\_vpc\_project\_id | Project for monitoring infra. |
| restricted\_shared\_vpc\_project\_id | Project for restricted shared VPC. |

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

Expand Down
6 changes: 3 additions & 3 deletions 2-environments/envs/production/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ output "monitoring_project_id" {
}

output "base_shared_vpc_project_id" {
description = "Project for monitoring infra."
description = "Project for base shared VPC."
value = module.env.base_shared_vpc_project_id
}

output "restricted_shared_vpc_project_id" {
description = "Project for monitoring infra."
description = "Project for restricted shared VPC."
value = module.env.restricted_shared_vpc_project_id
}

output "env_secrets_project_id" {
description = "Project for monitoring infra."
description = "Project for environment related secrets."
value = module.env.env_secrets_project_id
}