-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
97 additions
and
418 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# This script is used to deploy terraform configurations | ||
|
||
# Usage: ./terraform_deploy.sh <directory> | ||
|
||
DIR=$1 | ||
|
||
# Load environment variables from .env file | ||
if [ -f "$DIR/.env" ]; then | ||
set -a | ||
# shellcheck source=/dev/null | ||
. "$DIR/.env" | ||
set +a | ||
fi | ||
|
||
# Ensure TF_VAR_mgmt_resource_group_name is set | ||
if [ -z "${TF_VAR_mgmt_resource_group_name}" ]; then | ||
echo "Error: TF_VAR_mgmt_resource_group_name is not set." | ||
exit 1 | ||
fi | ||
|
||
# Ensure TF_VAR_mgmt_storage_account_name is set | ||
if [ -z "${TF_VAR_mgmt_storage_account_name}" ]; then | ||
echo "Error: TF_VAR_mgmt_storage_account_name is not set." | ||
exit 1 | ||
fi | ||
|
||
# Ensure TF_VAR_terraform_state_container_name is set | ||
if [ -z "${TF_VAR_terraform_state_container_name}" ]; then | ||
echo "Error: TF_VAR_terraform_state_container_name is not set." | ||
exit 1 | ||
fi | ||
|
||
# Ensure TRE_ID is set | ||
if [ -z "${TRE_ID}" ]; then | ||
echo "Error: TRE_ID is not set." | ||
exit 1 | ||
fi | ||
|
||
# Infer the key from the directory names | ||
PARENT_DIR=$(basename "$(dirname "$DIR")") | ||
GRANDPARENT_DIR=$(basename "$(dirname "$(dirname "$DIR")")") | ||
|
||
if [[ "$GRANDPARENT_DIR" == "workspaces" || "$GRANDPARENT_DIR" == "shared_services" ]]; then | ||
KEY="${TRE_ID?}_${TF_VAR_id?}_${PARENT_DIR}" | ||
elif [[ "$GRANDPARENT_DIR" == "workspace_services" ]]; then | ||
KEY="${TRE_ID?}_${TF_VAR_workspace_id?}_${TF_VAR_id?}_${PARENT_DIR}" | ||
elif [[ "$GRANDPARENT_DIR" == "user_resources" ]]; then | ||
KEY="${TRE_ID?}_${TF_VAR_workspace_id?}_${TF_VAR_workspace_service_id?}_${TF_VAR_id?}_${PARENT_DIR}" | ||
else | ||
KEY="${TRE_ID?}_${PARENT_DIR}" | ||
fi | ||
|
||
# Call terraform_wrapper.sh to handle terraform commands | ||
./devops/scripts/terraform_wrapper.sh \ | ||
-d "$DIR/terraform" \ | ||
-g "${TF_VAR_mgmt_resource_group_name}" \ | ||
-s "${TF_VAR_mgmt_storage_account_name}" \ | ||
-n "${TF_VAR_terraform_state_container_name}" \ | ||
-k "${KEY}" \ | ||
-c "terraform apply -auto-approve" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,5 @@ | |
**/.terraform/* | ||
**/*_backend.tf | ||
Dockerfile.tmpl | ||
terraform/deploy.sh | ||
|
||
terraform/destroy.sh |
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
templates/shared_services/airlock_notifier/terraform/deploy.sh
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,5 @@ | |
# TF backend files | ||
**/*_backend.tf | ||
Dockerfile.tmpl | ||
terraform/deploy.sh | ||
|
||
terraform/destroy.sh |
22 changes: 0 additions & 22 deletions
22
templates/shared_services/databricks-auth/terraform/deploy.sh
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
templates/shared_services/sonatype-nexus-vm/terraform/deploy.sh
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
templates/workspace_services/azureml/user_resources/aml_compute/terraform/deploy.sh
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
templates/workspace_services/azureml/user_resources/aml_compute/terraform/upgrade.sh
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
templates/workspace_services/azuresql/terraform/upgrade.sh
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,5 @@ | |
# TF backend files | ||
**/*_backend.tf | ||
Dockerfile.tmpl | ||
terraform/deploy.sh | ||
|
||
terraform/destroy.sh |
Oops, something went wrong.