1+ INFRA_ARGS =
2+
13# Local Commands
24local : install-dependencies
35 pipenv shell
46
57install-dependencies :
8+ pipenv clean
69 pipenv install --dev
710
811docs-install :
@@ -34,67 +37,122 @@ e2e:
3437 cd tests/; pipenv run behave
3538
3639# Infrastructure Commands
37- build-python :
38- pipenv requirements | tee requirements.txt
39- rsync -avu $(shell pwd) /src $(shell pwd) /infrastructure/aws/all_files
40- pip install -r requirements.txt --target=$(shell pwd) /infrastructure/aws/all_files
41- pip install boto3 --target=$(shell pwd) /infrastructure/aws/api_key_rotation
42- cd infrastructure/aws; cdktf provider add grafana/grafana
43- cd infrastructure/gcp; cdktf provider add grafana/grafana
4440
41+ # General
4542clean :
4643 cd infrastructure/aws; rm -rf cdktf.out
4744 cd infrastructure/gcp; rm -rf cdktf.out
4845
49- synth-aws :
50- cd infrastructure/aws; cdktf synth aws_infra_cdktf
51-
52- synth-grafana :
53- cd infrastructure/aws; cdktf synth grafana
46+ synth : aws-synth gcp-synth
5447
55- synth-gcp :
56- cd infrastructure/gcp; cdktf provider add grafana/grafana
57- cd infrastructure/gcp; cdktf synth base_gcp_infra
58- cd infrastructure/gcp; cdktf synth main_gcp_infra
59-
60- synth : synth-aws synth-grafana synth-gcp
48+ plan : aws-plan-all gcp-plan-all
6149
62- build : build-python synth
50+ deploy : aws-deploy-all gcp-deploy-all
6351
64- plan-aws :
65- cd infrastructure/aws; cdktf plan aws_infra_cdktf
52+ destroy : aws-destroy-all gcp-destroy-all
6653
67- plan-grafana :
68- cd infrastructure/aws; cdktf plan grafana
54+ # AWS
55+ aws-build-dependencies :
56+ @echo " \n\n---AWS-BUILD-DEPENDENCIES---\n"
57+ rsync -avu $(shell pwd) /src $(shell pwd) /infrastructure/aws/controller_core
58+ pipenv requirements | tee requirements.txt
59+ pip install -r requirements.txt --target=$(shell pwd) /infrastructure/aws/controller_core
60+ pip install boto3 --target=$(shell pwd) /infrastructure/aws/api_key_rotation
61+ cd infrastructure/aws; cdktf provider add grafana/grafana
62+
63+ aws-synth : aws-build-dependencies
64+ @echo " \n\n---AWS-SYNTH---\n"
65+ cd infrastructure/aws; cdktf synth
6966
70- plan-gcp :
71- cd infrastructure/gcp; cdktf plan base_gcp_infra main_gcp_infra
67+ aws-plan-core :
68+ @echo " \n\n---AWS-PLAN-CORE---\n"
69+ cd infrastructure/aws; cdktf plan aws_core
7270
73- plan-gcp-grafana :
74- cd infrastructure/gcp; cdktf plan grafana
71+ aws-plan-grafana :
72+ @echo " \n\n---AWS-PLAN-GRAFANA---\n"
73+ cd infrastructure/aws; cdktf plan aws_grafana_dashboard
7574
76- plan : build-python plan-aws plan-grafana plan-gcp
75+ aws- plan-all : aws- plan-core aws- plan-grafana
7776
78- plan-gcpstack : plan-gcp plan-grafana
77+ aws-deploy-core :
78+ @echo " \n\n---AWS-DEPLOY-CORE---\n"
79+ cd infrastructure/aws; cdktf deploy aws_core ${INFRA_ARGS}
7980
80- deploy :
81- cd infrastructure/aws; cdktf deploy aws_infra_cdktf grafana --auto-approve
81+ aws-deploy-grafana :
82+ @echo " \n\n---AWS-DEPLOY-GRAFANA---\n"
83+ cd infrastructure/aws; cdktf deploy aws_grafana_dashboard ${INFRA_ARGS}
8284
83- destroy-aws :
84- cd infrastructure/aws; cdktf destroy aws_infra_cdktf
85+ aws-deploy-all :
86+ @echo " \n\n---AWS-DEPLOY-ALL---\n"
87+ cd infrastructure/aws; cdktf deploy aws_core aws_grafana_dashboard ${INFRA_ARGS}
8588
86- destroy-grafana :
87- cd infrastructure/aws; cdktf destroy grafana
89+ aws-destroy-core :
90+ @echo " \n\n---AWS-DESTROY-CORE---\n"
91+ cd infrastructure/aws; cdktf destroy aws_core
8892
89- destroy : destroy-core destroy-grafana
93+ aws-destroy-grafana :
94+ @echo " \n\n---AWS-DESTROY-GRAFANA---\n"
95+ cd infrastructure/aws; cdktf destroy aws_grafana_dashboard
9096
91- deploy-base-gcp :
92- cd infrastructure/gcp; cdktf deploy base_gcp_infra --auto-approve
97+ aws-destroy-all :
98+ @echo " \n\n---AWS-DESTROY-ALL---\n"
99+ cd infrastructure/aws; cdktf destroy aws_core aws_grafana_dashboard
93100
94- deploy-main-gcp :
95- cd infrastructure/gcp; cdktf deploy base_gcp_infra main_gcp_infra --auto-approve
101+ # GCP
102+ gcp-build-dependencies :
103+ @echo " \n\n---GCP-BUILD-DEPENDENCIES---\n"
104+ cd infrastructure/gcp; cdktf provider add grafana/grafana
96105
97- build-image :
106+ gcp-build-image :
107+ @echo " \n\n---GCP-BUILD-IMAGE---\n"
98108 gcloud auth configure-docker australia-southeast1-docker.pkg.dev
99109 pipenv requirements | tee requirements.txt
100- docker buildx build --platform=linux/amd64 --push . -t australia-southeast1-docker.pkg.dev/contino-squad0-fc/flight-contoller-event-receiver/event_receiver:latest
110+ docker buildx build --platform=linux/amd64 --push . -t australia-southeast1-docker.pkg.dev/contino-squad0-fc/flight-contoller-event-receiver/event_receiver:latest
111+
112+ gcp-synth : gcp-build-dependencies
113+ @echo " \n\n---GCP-SYNTH---\n"
114+ cd infrastructure/gcp; cdktf synth
115+
116+ gcp-plan-base :
117+ @echo " \n\n---GCP-PLAN-BASE---\n"
118+ cd infrastructure/gcp; cdktf plan gcp_base
119+
120+ gcp-plan-core :
121+ @echo " \n\n---GCP-PLAN-CORE---\n"
122+ cd infrastructure/gcp; cdktf plan gcp_core
123+
124+ gcp-plan-grafana :
125+ @echo " \n\n---GCP-PLAN-GRAFANA---\n"
126+ cd infrastructure/gcp; cdktf plan gcp_grafana
127+
128+ gcp-plan-all : gcp-plan-base gcp-plan-core # gcp-plan-grafana
129+
130+ gcp-deploy-base :
131+ @echo " \n\n---GCP-DEPLOY-BASE---\n"
132+ cd infrastructure/gcp; cdktf deploy gcp_base ${INFRA_ARGS}
133+
134+ gcp-deploy-core :
135+ @echo " \n\n---GCP-DEPLOY-CORE---\n"
136+ cd infrastructure/gcp; cdktf deploy gcp_base gcp_core ${INFRA_ARGS}
137+
138+ gcp-deploy-grafana :
139+ @echo " \n\n---GCP-DEPLOY-GRAFANA---\n"
140+ cd infrastructure/gcp; cdktf deploy gcp_grafana ${INFRA_ARGS}
141+
142+ gcp-deploy-all : gcp-deploy-base gcp-build-image gcp-deploy-core # gcp-deploy-grafana
143+
144+ gcp-destroy-base :
145+ @echo " \n\n---GCP-DESTROY-BASE---\n"
146+ cd infrastructure/gcp; cdktf destroy gcp_base
147+
148+ gcp-destroy-core :
149+ @echo " \n\n---GCP-DESTROY-CORE---\n"
150+ cd infrastructure/gcp; cdktf destroy gcp_core
151+
152+ gcp-destroy-grafana :
153+ @echo " \n\n---GCP-DESTROY-GRAFANA---\n"
154+ cd infrastructure/gcp; cdktf destroy gcp_grafana
155+
156+ gcp-destroy-all :
157+ @echo " \n\n---GCP-DESTROY-ALL---\n"
158+ cd infrastructure/gcp; cdktf destroy gcp_base gcp_core gcp_grafana
0 commit comments