Skip to content

Commit

Permalink
Remove extra projects from business_unit_2 to help improve CI tests. …
Browse files Browse the repository at this point in the history
…Update readme with directions to optionally recreate.
  • Loading branch information
eeaton committed May 17, 2024
1 parent 0a69eac commit e7061be
Show file tree
Hide file tree
Showing 39 changed files with 86 additions and 1,170 deletions.
16 changes: 16 additions & 0 deletions 0-bootstrap/README-GitHub.md
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,8 @@ An environment variable `GOOGLE_IMPERSONATE_SERVICE_ACCOUNT` will be set with th
cd gcp-projects
```
1. Seed the repository if it has not been initialized yet.
```bash
Expand Down Expand Up @@ -878,6 +880,20 @@ An environment variable `GOOGLE_IMPERSONATE_SERVICE_ACCOUNT` will be set with th
sed -i'' -e "s/REMOTE_STATE_BUCKET/${remote_state_bucket}/" ./common.auto.tfvars
```
1. (Optional) If you want additional subfolders for separate business units or entities, make additional copies of the folder `business_unit_1` and modify any values that vary across business unit like `business_code`, `business_unit`, or `subnet_ip_range`.
For example, to create a new business unit similar to business_unit_1, run the following:
```bash
#copy the business_unit_1 folder and it's contents to a new folder business_unit_2
cp -r business_unit_1 business_unit_2

# search all files under the folder `business_unit_2` and replace strings for business_unit_1 with strings for business_unit_2
grep -rl bu1 business_unit_2/ | xargs sed -i 's/bu1/bu2/g'
grep -rl business_unit_1 business_unit_2/ | xargs sed -i 's/business_unit_1/business_unit_2/g'
```
1. Commit changes.
```bash
Expand Down
14 changes: 14 additions & 0 deletions 0-bootstrap/README-GitLab.md
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,20 @@ An environment variable `GOOGLE_IMPERSONATE_SERVICE_ACCOUNT` will be set with th
sed -i'' -e "s/REMOTE_STATE_BUCKET/${remote_state_bucket}/" ./common.auto.tfvars
```
1. (Optional) If you want additional subfolders for separate business units or entities, make additional copies of the folder `business_unit_1` and modify any values that vary across business unit like `business_code`, `business_unit`, or `subnet_ip_range`.
For example, to create a new business unit similar to business_unit_1, run the following:
```bash
#copy the business_unit_1 folder and it's contents to a new folder business_unit_2
cp -r business_unit_1 business_unit_2

# search all files under the folder `business_unit_2` and replace strings for business_unit_1 with strings for business_unit_2
grep -rl bu1 business_unit_2/ | xargs sed -i 's/bu1/bu2/g'
grep -rl business_unit_1 business_unit_2/ | xargs sed -i 's/business_unit_1/business_unit_2/g'
```
1. Commit changes.
```bash
Expand Down
14 changes: 14 additions & 0 deletions 0-bootstrap/README-Jenkins.md
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,20 @@ Here you will configure a VPN Network tunnel to enable connectivity between the
sed -i'' -e "s/REMOTE_STATE_BUCKET/${backend_bucket}/" ./common.auto.tfvars
```

1. (Optional) If you want additional subfolders for separate business units or entities, make additional copies of the folder `business_unit_1` and modify any values that vary across business unit like `business_code`, `business_unit`, or `subnet_ip_range`.

For example, to create a new business unit similar to business_unit_1, run the following:

```bash
#copy the business_unit_1 folder and it's contents to a new folder business_unit_2
cp -r business_unit_1 business_unit_2

# search all files under the folder `business_unit_2` and replace strings for business_unit_1 with strings for business_unit_2
grep -rl bu1 business_unit_2/ | xargs sed -i 's/bu1/bu2/g'
grep -rl business_unit_1 business_unit_2/ | xargs sed -i 's/business_unit_1/business_unit_2/g'
```


1. Commit changes.

```bash
Expand Down
14 changes: 14 additions & 0 deletions 0-bootstrap/README-Terraform-Cloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,20 @@ An environment variable `GOOGLE_IMPERSONATE_SERVICE_ACCOUNT` will be set with th
terraform -chdir="business_unit_2/shared/" init
```
1. (Optional) If you want additional subfolders for separate business units or entities, make additional copies of the folder `business_unit_1` and modify any values that vary across business unit like `business_code`, `business_unit`, or `subnet_ip_range`.
For example, to create a new business unit similar to business_unit_1, run the following:
```bash
#copy the business_unit_1 folder and it's contents to a new folder business_unit_2
cp -r business_unit_1 business_unit_2

# search all files under the folder `business_unit_2` and replace strings for business_unit_1 with strings for business_unit_2
grep -rl bu1 business_unit_2/ | xargs sed -i 's/bu1/bu2/g'
grep -rl business_unit_1 business_unit_2/ | xargs sed -i 's/business_unit_1/business_unit_2/g'
```
1. Commit changes
```bash
Expand Down
28 changes: 28 additions & 0 deletions 4-projects/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,20 @@ Run `terraform output cloudbuild_project_id` in the `0-bootstrap` folder to get
sed -i'' -e "s/REMOTE_STATE_BUCKET/${remote_state_bucket}/" ./common.auto.tfvars
```

1. (Optional) If you want additional subfolders for separate business units or entities, make additional copies of the folder `business_unit_1` and modify any values that vary across business unit like `business_code`, `business_unit`, or `subnet_ip_range`.

For example, to create a new business unit similar to business_unit_1, run the following:

```bash
#copy the business_unit_1 folder and it's contents to a new folder business_unit_2
cp -r business_unit_1 business_unit_2

# search all files under the folder `business_unit_2` and replace strings for business_unit_1 with strings for business_unit_2
grep -rl bu1 business_unit_2/ | xargs sed -i 's/bu1/bu2/g'
grep -rl business_unit_1 business_unit_2/ | xargs sed -i 's/business_unit_1/business_unit_2/g'
```


1. Commit changes.

```bash
Expand Down Expand Up @@ -268,6 +282,20 @@ To use the `validate` option of the `tf-wrapper.sh` script, please follow the [i
echo ${GOOGLE_IMPERSONATE_SERVICE_ACCOUNT}
```

1. (Optional) If you want additional subfolders for separate business units or entities, make additional copies of the folder `business_unit_1` and modify any values that vary across business unit like `business_code`, `business_unit`, or `subnet_ip_range`.

For example, to create a new business unit similar to business_unit_1, run the following:

```bash
#copy the business_unit_1 folder and it's contents to a new folder business_unit_2
cp -r business_unit_1 business_unit_2

# search all files under the folder `business_unit_2` and replace strings for business_unit_1 with strings for business_unit_2
grep -rl bu1 business_unit_2/ | xargs sed -i 's/bu1/bu2/g'
grep -rl business_unit_1 business_unit_2/ | xargs sed -i 's/business_unit_1/business_unit_2/g'
```


1. Run `init` and `plan` and review output for environment shared.

```bash
Expand Down
37 changes: 0 additions & 37 deletions 4-projects/business_unit_2/development/README.md

This file was deleted.

22 changes: 0 additions & 22 deletions 4-projects/business_unit_2/development/backend.tf

This file was deleted.

23 changes: 0 additions & 23 deletions 4-projects/business_unit_2/development/backend.tf.cloud.example

This file was deleted.

1 change: 0 additions & 1 deletion 4-projects/business_unit_2/development/common.auto.tfvars

This file was deleted.

This file was deleted.

31 changes: 0 additions & 31 deletions 4-projects/business_unit_2/development/main.tf

This file was deleted.

110 changes: 0 additions & 110 deletions 4-projects/business_unit_2/development/outputs.tf

This file was deleted.

Loading

0 comments on commit e7061be

Please sign in to comment.