Skip to content

Commit f0771b8

Browse files
author
James Chapman
committed
refine scripts
1 parent f67b367 commit f0771b8

File tree

2 files changed

+8
-17
lines changed

2 files changed

+8
-17
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,13 @@ tre-start: ## ⏩ Start the TRE Service
177177
&& ${MAKEFILE_DIR}/devops/scripts/control_tre.sh start
178178

179179
# Description: Stop the TRE Service.
180+
# Arguments: DELETE_SERVICE_BUS - if set to true, the service bus will also be deleted to save costs.
180181
# # This will deallocate the Azure Firewall public IP and stop the Azure Application Gateway service, stopping billing of both services.
181182
# Example: make tre-stop
182-
# Example: make tre-stop DELETE_SERVICE_BUS=true
183183
tre-stop: ## ⛔ Stop the TRE Service
184184
$(call target_title, "Stopping TRE") \
185185
&& . ${MAKEFILE_DIR}/devops/scripts/bootstrap_azure_env.sh \
186-
&& ${MAKEFILE_DIR}/devops/scripts/control_tre.sh stop $(shell if [ "$(DELETE_SERVICE_BUS)" = "true" ]; then echo "--delete-service-bus"; fi)
186+
&& ${MAKEFILE_DIR}/devops/scripts/control_tre.sh stop
187187

188188
# Description: Destroy the TRE Service. This will destroy all the resources of the TRE service, including the Azure Firewall and Application Gateway.
189189
# Example: make tre-destroy

devops/scripts/control_tre.sh

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ if [[ -z ${TRE_ID:-} ]]; then
99
exit 1
1010
fi
1111

12-
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
1312
core_rg_name="rg-${TRE_ID}"
1413
fw_name="fw-${TRE_ID}"
1514
agw_name="agw-$TRE_ID"
@@ -27,24 +26,16 @@ az config set extension.use_dynamic_install=yes_without_prompt
2726
az --version
2827

2928
# shellcheck disable=SC1091
30-
source "${SCRIPT_DIR}/kv_add_network_exception.sh"
31-
32-
DELETE_SERVICE_BUS=false
33-
COMMAND=""
34-
for arg in "$@"; do
35-
case $arg in
36-
*start*) COMMAND="start" ;;
37-
*stop*) COMMAND="stop" ;;
38-
--delete-service-bus) DELETE_SERVICE_BUS=true ;;
39-
esac
40-
done
29+
# source "${SCRIPT_DIR}/kv_add_network_exception.sh"
30+
31+
COMMAND="${1:-}"
32+
DELETE_SERVICE_BUS="${DELETE_SERVICE_BUS:-false}"
4133

4234
if [[ "$COMMAND" == "start" ]]; then
4335
# Check if Service Bus exists
4436
if [[ $(az servicebus namespace list --resource-group "${core_rg_name}" --query "[?name=='sb-${TRE_ID}'] | length(@)") == 0 ]]; then
45-
echo -e "\e[31mService Bus namespace 'sb-${TRE_ID}' does not exist.\e[0m"
46-
echo -e "\e[31mIf the TRE was stopped or never deployed, please run 'make tre-deploy' to provision the infrastructure.\e[0m"
47-
exit 1
37+
echo -e "\e[33mService Bus namespace 'sb-${TRE_ID}' does not exist.\e[0m"
38+
echo -e "\e[33mIf you ran 'make tre-start' you will also need to run 'make deploy-core' to reprovision the Service Bus.\e[0m"
4839
fi
4940

5041
if [[ $(az network firewall list --output json --query "[?resourceGroup=='${core_rg_name}'&&name=='${fw_name}'] | length(@)") != 0 ]]; then

0 commit comments

Comments
 (0)