File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ function _bootstrap_help() {
2828}
2929
3030function _check_mgmt() {
31- if [ " $( aws iam list-account-aliases --query ' AccountAliases[0]' --output text) " != " nhsd-ddc-spine-nrlf-mgmt" ]; then
31+ if [[ " $( aws iam list-account-aliases --query ' AccountAliases[0]' --output text) " != " nhsd-ddc-spine-nrlf-mgmt" ] ]; then
3232 echo " Please log in as the mgmt account" >&2
3333 return 1
3434 fi
@@ -98,7 +98,7 @@ function _bootstrap() {
9898 set +e
9999 mgmt_account_id=$( aws secretsmanager get-secret-value --secret-id " ${MGMT_ACCOUNT_ID_LOCATION} " --query SecretString --output text)
100100
101- if [ " ${mgmt_account_id} " == " " ]; then
101+ if [[ " ${mgmt_account_id} " == " " ] ]; then
102102 aws secretsmanager create-secret --name " ${MGMT_ACCOUNT_ID_LOCATION} "
103103 echo " Please set ${MGMT_ACCOUNT_ID_LOCATION} in the Secrets Manager and rerun the script"
104104 exit 1
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ set -o errexit -o pipefail -o nounset
66: " ${SHOULD_WARN_ONLY:= " false" } "
77
88function success() {
9- [ " ${SHOULD_WARN_ONLY} " == " true" ] && return
9+ [[ " ${SHOULD_WARN_ONLY} " == " true" ] ] && return
1010
1111 local message=" $1 "
1212 echo " ✅ ${message} "
@@ -38,7 +38,7 @@ for dep in ${BUILD_DEPENDENCIES}; do
3838 dep_path=" $( which ${dep} 2> /dev/null) "
3939 set -e
4040
41- if [ -n " ${dep_path} " -a -x " ${dep_path} " ]
41+ if [[ -n " ${dep_path} " -a -x " ${dep_path} " ] ]
4242 then
4343 success " ${dep} found at ${dep_path} "
4444 else
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ set -o errexit -o pipefail -o nounset
99: " ${TF_WORKSPACE_NAME:= " " } "
1010
1111function success() {
12- [ " ${SHOULD_WARN_ONLY} " == " true" ] && return
12+ [[ " ${SHOULD_WARN_ONLY} " == " true" ] ] && return
1313
1414 local message=" $1 "
1515 echo " ✅ ${message} "
@@ -33,7 +33,7 @@ for dep in ${DEPLOY_DEPENDENCIES}; do
3333 dep_path=" $( which ${dep} 2> /dev/null) "
3434 set -e
3535
36- if [ -n " ${dep_path} " -a -x " ${dep_path} " ]
36+ if [[ -n " ${dep_path} " -a -x " ${dep_path} " ] ]
3737 then
3838 success " ${dep} found at ${dep_path} "
3939 else
4545set +e
4646env_account_id=" $( aws secretsmanager get-secret-value --secret-id nhsd-nrlf--mgmt--${ENV_ACCOUNT_NAME} -account-id --query SecretString --output text) "
4747set -e
48- if [ -n " ${env_account_id} " ]
48+ if [[ -n " ${env_account_id} " ] ]
4949then
5050 success " ${ENV_ACCOUNT_NAME} account id found in mgmt account"
5151else
@@ -59,7 +59,7 @@ tf_workspace="$(cd terraform/infrastructure && terraform workspace show)"
5959set -e
6060
6161is_using_shared_resources=" $( poetry run python ./scripts/are_resources_shared_for_stack.py ${tf_workspace} ) "
62- if [ " ${is_using_shared_resources} " == " true" ]
62+ if [[ " ${is_using_shared_resources} " == " true" ] ]
6363then
6464 warning " Will use shared resources for stack '${tf_workspace} '"
6565else
Original file line number Diff line number Diff line change 22# Get the account name for the provided NRLF environment
33set -o errexit -o nounset -o pipefail
44
5- if [ $# -ne 1 ]; then
5+ if [[ $# -ne 1 ] ]; then
66 echo " Usage: get-account-name-for-env.sh <env>"
77 exit 1
88fi
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ BRANCH_NAME="$(git rev-parse --abbrev-ref HEAD)"
66TAG_NAME=" $( git describe --tags || echo " no-tags" ) "
77SHORT_COMMIT_HASH=" $( git rev-parse --short=8 HEAD) "
88
9- if [ " ${BRANCH_NAME} " == " HEAD" ]; then
9+ if [[ " ${BRANCH_NAME} " == " HEAD" ] ]; then
1010 NRLF_VERSION=" ${TAG_NAME} @${SHORT_COMMIT_HASH} "
1111else
1212 NRLF_VERSION=" ${BRANCH_NAME} @${SHORT_COMMIT_HASH} "
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ set -o errexit -o nounset -o pipefail
44
55: " ${DIST_DIR:= " ./dist" } "
66
7- if [ $# -ne 1 ]
7+ if [[ $# -ne 1 ] ]
88then
99 echo " Error: stack-name argument is missing" 1>&2
1010 echo " Usage: $0 <stack-name>" 1>&2
4444echo " Pulling code for consumer API lambdas...."
4545for endpoint_path in api/consumer/*
4646do
47- if [ ! -d " ${endpoint_path} " ]
47+ if [[ ! -d " ${endpoint_path} " ] ]
4848 then
4949 continue
5050 fi
5757echo " Pulling code for producer API lambdas...."
5858for endpoint_path in api/producer/*
5959do
60- if [ ! -d " ${endpoint_path} " ]
60+ if [[ ! -d " ${endpoint_path} " ] ]
6161 then
6262 continue
6363 fi
You can’t perform that action at this time.
0 commit comments