Skip to content

Commit 66e3980

Browse files
committed
migrate to pre-entrypoint helper
1 parent b42e5c2 commit 66e3980

File tree

2 files changed

+19
-38
lines changed

2 files changed

+19
-38
lines changed

.config/static_tests/pre-entrypoint-helpers.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,22 @@
33
## use this to load any configuration before the static test
44
## TIPS: avoid modifying the .project_automation/static_test/entrypoint.sh
55
## migrate any customization you did on entrypoint.sh to this helper script
6-
echo "Executing Pre-Entrypoint Helpers"
6+
echo "Executing Pre-Entrypoint Helpers"
7+
8+
#********** TFC Env Vars *************
9+
export AWS_DEFAULT_REGION=us-east-1
10+
export TFE_TOKEN=`aws secretsmanager get-secret-value --secret-id abp/tfc/token | jq -r ".SecretString"`
11+
export TF_TOKEN_app_terraform_io=`aws secretsmanager get-secret-value --secret-id abp/tfc/token | jq -r ".SecretString"`
12+
13+
#********** MAKEFILE *************
14+
echo "Build the lambda function packages"
15+
make all
16+
17+
#********** Get tfvars from SSM *************
18+
echo "Get *.tfvars from SSM parameter"
19+
aws ssm get-parameter \
20+
--name "/abp/tfc/functional/tfvars" \
21+
--with-decryption \
22+
--query "Parameter.Value" \
23+
--output "text" \
24+
--region "us-east-1" >> functional_test.tfvars

.project_automation/functional_tests/entrypoint.sh

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -43,45 +43,8 @@ else
4343
EXIT_CODE=1
4444
fi
4545

46-
<<<<<<< before updating
47-
#********** TFC Env Vars *************
48-
export AWS_DEFAULT_REGION=us-east-1
49-
export TFE_TOKEN=`aws secretsmanager get-secret-value --secret-id abp/tfc/token | jq -r ".SecretString"`
50-
export TF_TOKEN_app_terraform_io=`aws secretsmanager get-secret-value --secret-id abp/tfc/token | jq -r ".SecretString"`
51-
52-
#********** MAKEFILE *************
53-
echo "Build the lambda function packages"
54-
make all
55-
56-
#********** Get tfvars from SSM *************
57-
echo "Get *.tfvars from SSM parameter"
58-
aws ssm get-parameter \
59-
--name "/abp/tfc/functional/tfvars" \
60-
--with-decryption \
61-
--query "Parameter.Value" \
62-
--output "text" \
63-
--region "us-east-1" >> functional_test.tfvars
64-
65-
#********** Terratest execution **********
66-
echo "Running Terratest"
67-
export GOPROXY=https://goproxy.io,direct
68-
cd test
69-
rm -f go.mod
70-
go mod init github.com/aws-ia/terraform-project-ephemeral
71-
go mod tidy
72-
go install github.com/gruntwork-io/terratest/modules/terraform
73-
go test -timeout 45m
74-
75-
#********** CLEANUP *************
76-
echo "Cleaning up all temp files and artifacts"
77-
cd ${PROJECT_PATH}
78-
make clean
79-
80-
echo "End of Functional Tests"
81-
=======
8246
#********** Post-entrypoint helper *************
8347
post_entrypoint
8448

8549
#********** Exit Code *************
8650
exit $EXIT_CODE
87-
>>>>>>> after updating

0 commit comments

Comments
 (0)