-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·54 lines (44 loc) · 1.88 KB
/
build.sh
File metadata and controls
executable file
·54 lines (44 loc) · 1.88 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh
# Generate all Cardinal CloudFormation artifacts.
set -e
if [ -d ".venv" ]; then
. .venv/bin/activate
else
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
fi
if [ -d "generated-templates" ]; then
rm -rf generated-templates
fi
mkdir -p generated-templates/cardinal-lakerunner
export PYTHONPATH="$(pwd)/src${PYTHONPATH:+:$PYTHONPATH}"
echo "Generating cardinal-vpc.yaml..."
python3 -m cardinal_cfn.cardinal_vpc > generated-templates/cardinal-vpc.yaml
echo "Generating cardinal-infrastructure.yaml..."
python3 -m cardinal_cfn.cardinal_infrastructure > generated-templates/cardinal-infrastructure.yaml
# ---------------------------------------------------------------------------
# Lakerunner stack (root + 8 nested children). Children take role ARNs,
# security-group IDs, and infra identifiers (cluster, RDS, S3, SQS, secrets,
# SSM params) as parameters from the customer / scripts/data-setup.sh.
# ---------------------------------------------------------------------------
echo "Generating cardinal-lakerunner.yaml (root)..."
python3 -m cardinal_cfn.root > generated-templates/cardinal-lakerunner.yaml
for child in alb cert migration \
services_query services_process services_control otel maestro; do
out_name=$(echo "$child" | tr '_' '-')
echo "Generating cardinal-lakerunner/${out_name}.yaml..."
python3 -m "cardinal_cfn.children.${child}" > "generated-templates/cardinal-lakerunner/${out_name}.yaml"
done
echo
echo "Linting CFN templates..."
cfn-lint generated-templates/cardinal-vpc.yaml \
generated-templates/cardinal-infrastructure.yaml \
generated-templates/cardinal-lakerunner.yaml \
generated-templates/cardinal-lakerunner/*.yaml || \
echo "cfn-lint completed with warnings"
echo
echo "Generated artifacts:"
ls -la generated-templates/
echo " cardinal-lakerunner/:"
ls generated-templates/cardinal-lakerunner/