Skip to content

Commit 03d65a0

Browse files
Merge pull request #1100 from NHSDigital/NRL-1595-account-wide-infra-fix
NRL-1595 Experimenting with cert envs needed to deploy account changes
2 parents 3c0c778 + 8fc02ca commit 03d65a0

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

scripts/truststore.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ function _truststore_help() {
2525
echo " pull-ca-key <ca> - Pull the certificate authority private key"
2626
echo " pull-client <env> - pull the files needed for a client connection"
2727
echo " pull-server <env> - pull the files needed for a server connection"
28+
echo " pull-all-for-account <acc> - pull all the truststore files for all environments in a given account"
2829
echo " pull-all <env> - pull all the truststore files for an environment"
2930
echo " push-all <env> - push all the truststore files for an environment"
3031
echo " rotate-ca <env> - rotate the certificate authority, archiving the previous one"
@@ -318,13 +319,15 @@ function _truststore_pull_all_for_account() {
318319
# sets envs_array
319320
source ./scripts/get-envs-for-account.sh $account
320321

321-
echo "Pulling certs for environments ${envs_array[@]} in ${account} account"
322-
323322
for env in ${envs_array[@]}; do
324-
echo "⏳ Pulling ${env} truststore certs"
325-
_truststore_pull_ca $env
326-
_truststore_pull_client $env
327-
_truststore_pull_server $env
323+
# don't need to pull sandbox certs
324+
if [[ $env != *"-sandbox" ]];
325+
then
326+
echo "⏳ Pulling ${env} truststore certs"
327+
_truststore_pull_ca $env
328+
_truststore_pull_client $env
329+
_truststore_pull_server $env
330+
fi
328331
done
329332

330333
echo -e "✅ Successfully pulled all ${account} truststore files from s3://${BUCKET}"

0 commit comments

Comments
 (0)