Skip to content

Commit 4fc8391

Browse files
committed
CCM-11029: revert things
1 parent dc4739d commit 4fc8391

File tree

3 files changed

+10
-17
lines changed

3 files changed

+10
-17
lines changed

infrastructure/terraform/bin/terraform.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ rm -rf ${component_path}/.terraform;
391391

392392
# Run global pre.sh
393393
if [ -f "pre.sh" ]; then
394-
bash pre.sh "${region}" "${environment}" "${action}" \
394+
source pre.sh "${region}" "${environment}" "${action}" \
395395
|| error_and_die "Global pre script execution failed with exit code ${?}";
396396
fi;
397397

@@ -427,12 +427,10 @@ fi;
427427

428428
# Run pre.sh
429429
if [ -f "pre.sh" ]; then
430-
bash pre.sh "${region}" "${environment}" "${action}" \
430+
source pre.sh "${region}" "${environment}" "${action}" \
431431
|| error_and_die "Component pre script execution failed with exit code ${?}";
432432
fi;
433433

434-
echo "component pre.sh completed"
435-
436434
# Pull down secret TFVAR file from S3
437435
# Anti-pattern and security warning: This secrets mechanism provides very little additional security.
438436
# It permits you to inject secrets directly into terraform without storing them in source control or unencrypted in S3.
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
#!/usr/bin/env bash
2-
3-
set -euo pipefail
4-
51
echo "Running app pre.sh"
62

7-
cd $(git rev-parse --show-toplevel)
3+
pushd $(git rev-parse --show-toplevel)
84

95
make dependencies
106

@@ -13,3 +9,5 @@ npm run generate-dependencies --workspaces --if-present
139
npm run lambda-build --workspaces --if-present
1410

1511
$(git rev-parse --show-toplevel)/lambdas/layers/pdfjs/build.sh
12+
13+
popd

infrastructure/terraform/components/sandbox/pre.sh

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
1-
#!/usr/bin/env bash
2-
3-
set -euo pipefail
4-
51
REGION=$1
62
ENVIRONMENT=$2
73
ACTION=$3
84

9-
echo "Running pre.sh latest version"
5+
echo "Running pre.sh latestest version"
106
echo "REGION=$REGION"
117
echo "ENVIRONMENT=$ENVIRONMENT"
128
echo "ACTION=$ACTION"
139

10+
pushd $(git rev-parse --show-toplevel)
11+
1412
if [ "${ACTION}" == "apply" ]; then
15-
cd $(git rev-parse --show-toplevel)
1613
echo "Building lambdas for distribution"
1714

18-
if [[ -z "${SKIP_SANDBOX_INSTALL:-}" ]]; then
15+
if [[ -z $SKIP_SANDBOX_INSTALL ]]; then
1916
echo "Installing dependencies"
2017
make dependencies;
2118
else
@@ -32,4 +29,4 @@ else
3229
echo "Skipping lambda build for action $ACTION"
3330
fi
3431

35-
exit 0
32+
popd

0 commit comments

Comments
 (0)