-
Notifications
You must be signed in to change notification settings - Fork 0
/
launch.sh
executable file
·34 lines (25 loc) · 950 Bytes
/
launch.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
# Remove old runs
if [ -d "${PWD}"/cdk.out ]; then rm -Rf "${PWD}"/cdk.out; fi
# Force latest version
docker pull localstack/localstack:latest
# Stop/start localstack
docker stop "$(docker ps -a -q --filter="name=localstack")" &>/dev/null
docker rm "$(docker ps -a -q --filter="name=localstack")" &>/dev/null
docker run -d -p 4566:4566 --name=localstack localstack/localstack:latest
# Compile the stack
mvn clean package && cdk synth \*
echo "Waiting for stack to startup..."
sleep 10s
# Execute cloudformation template
for templateFile in ./cdk.out/*.template.json; do
stackName=${templateFile%.template*}
echo "Installing: ${stackName##*/}"
aws cloudformation create-stack \
--endpoint-url=http://localhost:4566 \
--stack-name "${stackName##*/}" \
--template-body file://"${templateFile}" \
--region us-east-1 \
>> output.txt
done
docker logs -f localstack