-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move duplicated logic to scripts (#3371)
* move construction of tre_url to script and source it * Use Azure environment in local deployment * move conversion of azure_env to arm_env to script and source it * remove bash options * Update devops/scripts/load_and_validate_env.sh Co-authored-by: Tamir Kamara <26870601+tamirkamara@users.noreply.github.com> * Update devops/scripts/load_and_validate_env.sh Co-authored-by: Tamir Kamara <26870601+tamirkamara@users.noreply.github.com> --------- Co-authored-by: LizaShak <iliza@outlook.com> Co-authored-by: Tamir Kamara <26870601+tamirkamara@users.noreply.github.com>
- Loading branch information
1 parent
ab78cd7
commit 2e470e7
Showing
4 changed files
with
50 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
# This script is designed to be `source`d to create reusable helper functions | ||
|
||
function construct_tre_url() | ||
{ | ||
tre_id=$1 | ||
location=$2 | ||
azure_environment=$3 | ||
|
||
declare -A cloudapp_endpoint_suffixes=( ["AzureCloud"]="cloudapp.azure.com" ["AzureUSGovernment"]="cloudapp.usgovcloudapi.net" ) | ||
domain=${cloudapp_endpoint_suffixes[${azure_environment}]} | ||
|
||
echo https://"${tre_id}"."${location}"."${domain}" | ||
} |
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,10 @@ | ||
#!/bin/bash | ||
|
||
# This script is designed to be `source`d to create reusable helper functions | ||
|
||
function convert_azure_env_to_arm_env() | ||
{ | ||
azure_environment=$1 | ||
declare -A arm_envs=( ["AzureCloud"]="public" ["AzureUSGovernment"]="usgovernment") | ||
echo "${arm_envs[${azure_environment}]}" | ||
} |
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