Skip to content
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

re-organize scripts to make end-user actions easier to find #204

Merged
merged 15 commits into from
May 12, 2021
8 changes: 4 additions & 4 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@ For more on workflows: <https://docs.github.com/en/actions/reference/workflow-sy

1. MLZ Setup

To apply terraform at all, locally, or from this automation, `scripts/mlz_tf_setup.sh` must be run to create the storage accounts to store Terraform state and create the Service Principal with authorization to deploy resources into the configured subscription(s).
To apply terraform at all, locally, or from this automation, `src/scripts/config/create_mlz_configuration_resources.sh` must be run to create the storage accounts to store Terraform state and create the Service Principal with authorization to deploy resources into the configured subscription(s).

See the root README's [Configure the Terraform Backend](#../..//README.md/#Configure-the-Terraform-Backend) on how to do this.

1. Configuration store

When applying terraform locally or from this automation, an MLZ Configuration file (commonly mlz_tf_cfg.var) and Terraform-specific variables files (commonly *.tfvars) are required.
When applying terraform locally or from this automation, an MLZ Configuration file (commonly mlz.config) and Terraform-specific variables files (commonly *.tfvars) are required.

You should end up with a container with these files:

File Name | Value
------------ | -------------
mlz_tf_cfg.var | An MLZ Configuration file that comes from mlz_tf_setup.sh
mlz.config | An MLZ Configuration file that comes from create_mlz_configuration_resources.sh
globals.tfvars | Global MLZ terraform values
saca-hub.tfvars | SACA Hub MLZ terraform values
tier-0.tfvars | Tier 0 MLZ terraform values
Expand All @@ -59,7 +59,7 @@ For more on workflows: <https://docs.github.com/en/actions/reference/workflow-sy
./build/get_vars.sh

# pulls down these files:
vars/mlz_tf_cfg.var
vars/mlz.config
vars/globals.tfvars
vars/saca-hub.tfvars
vars/tier-0.tfvars
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/apply-and-destroy-terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
run : |
cd src/build
./apply_tf.sh \
vars/mlz_tf_cfg.var \
vars/mlz.config \
vars/globals.tfvars \
vars/saca-hub.tfvars \
vars/tier-0.tfvars \
Expand All @@ -51,7 +51,7 @@ jobs:
run : |
cd src/build
./destroy_tf.sh \
vars/mlz_tf_cfg.var \
vars/mlz.config \
vars/globals.tfvars \
vars/saca-hub.tfvars \
vars/tier-0.tfvars \
Expand Down
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ terraform-provider-random_v*
*.terraform.lock.hcl

# Setup config variables file
mlz_tf_cfg.var
mlz.config
saca-hub.tfvars.json
tier-0.tfvars.json
tier-1.tfvars.json
Expand Down Expand Up @@ -50,5 +50,7 @@ __pycache__/
**/config_output/
**/exec_output

# ignore deploy.sh output
# ignore generated output
**/generated-configurations/*
mlz.zip
mlz.tar
8 changes: 4 additions & 4 deletions src/build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ usage() {
```

```shell
# assuming src/scripts/mlz_tf_setup.sh has been run before...
# assuming src/scripts/config/create_mlz_configuration_resources.sh has been run before...
./apply_tf.sh \
./path-to/mlz_tf_cfg.var \
./path-to/mlz.config \
./path-to/globals.tfvars \
./path-to/saca-hub.tfvars \
./path-to/tier-0.tfvars \
Expand All @@ -47,9 +47,9 @@ usage() {
```

```shell
# assuming src/scripts/mlz_tf_setup.sh has been run before...
# assuming src/scripts/config/create_mlz_configuration_resources.sh has been run before...
./destroy_tf.sh \
./path-to/mlz_tf_cfg.var \
./path-to/mlz.config \
./path-to/globals.tfvars \
./path-to/saca-hub.tfvars \
./path-to/tier-0.tfvars \
Expand Down
4 changes: 2 additions & 2 deletions src/build/apply_tf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ apply() {
attempts=1
max_attempts=5

apply_command="${scripts_path}/apply_terraform.sh ${globals} ${path} ${tf_vars} y"
destroy_command="${scripts_path}/destroy_terraform.sh ${globals} ${path} ${tf_vars} y"
apply_command="${scripts_path}/terraform/apply_terraform.sh ${globals} ${path} ${tf_vars} y"
destroy_command="${scripts_path}/terraform/destroy_terraform.sh ${globals} ${path} ${tf_vars} y"

if [[ $display_tf_output == "n" ]]; then
apply_command+=" &>/dev/null"
Expand Down
2 changes: 1 addition & 1 deletion src/build/destroy_tf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ destroy() {
attempts=1
max_attempts=5

destroy_command="${scripts_path}/destroy_terraform.sh ${globals} ${path} ${tf_vars} y"
destroy_command="${scripts_path}/terraform/destroy_terraform.sh ${globals} ${path} ${tf_vars} y"

if [[ "$display_tf_output" == "n" ]]; then
destroy_command+=" &>/dev/null"
Expand Down
116 changes: 0 additions & 116 deletions src/clean.sh

This file was deleted.

Loading