@@ -3,12 +3,12 @@ export AWS_SECRET_ACCESS_KEY ?= test
33export AWS_DEFAULT_REGION =us-east-1
44SHELL := /bin/bash
55
6- # # Show this help
7- usage :
8- @fgrep -h " ##" $(MAKEFILE_LIST ) | fgrep -v fgrep | sed -e ' s/\\$$//' | sed -e ' s/##//'
6+ usage : # # Show this help in table format
7+ @echo " | Target | Description |"
8+ @echo " |------------------------|-------------------------------------------------------------------|"
9+ @fgrep -h " ##" $(MAKEFILE_LIST ) | fgrep -v fgrep | sed -e ' s/:.*##\s*/##/g' | awk -F' ##' ' { printf "| %-22s | %-65s |\n", $$1, $$2 }'
910
10- # # Check if all required prerequisites are installed
11- check :
11+ check : # # Check if all required prerequisites are installed
1212 @command -v docker > /dev/null 2>&1 || { echo " Docker is not installed. Please install Docker and try again." ; exit 1; }
1313 @command -v node > /dev/null 2>&1 || { echo " Node.js is not installed. Please install Node.js and try again." ; exit 1; }
1414 @command -v aws > /dev/null 2>&1 || { echo " AWS CLI is not installed. Please install AWS CLI and try again." ; exit 1; }
1919 @command -v awslocal > /dev/null 2>&1 || { echo " awslocal is not installed. Please install awslocal and try again." ; exit 1; }
2020 @echo " All required prerequisites are available."
2121
22- # # Install dependencies
23- install :
22+ install : # # Install all required dependencies
2423 @if [ ! -d " node_modules" ]; then \
2524 echo " node_modules not found. Running npm install..." ; \
2625 npm install; \
@@ -31,39 +30,33 @@ install:
3130 fi
3231 @echo " All required dependencies are available."
3332
34- # # Deploy the infrastructure
35- deploy :
33+ deploy : # # Deploy the CDK stack
3634 @echo " Bootstrapping CDK..."
3735 cdklocal bootstrap
3836 @echo " Deploying CDK..."
3937 cdklocal deploy --require-approval never
4038 @echo " CDK deployed successfully."
4139
42- # # Run the tests
43- test :
40+ test : # # Run the tests
4441 @echo " Running tests..."
4542 npm test
4643 @echo " Tests completed successfully."
4744
48- # # Start LocalStack in detached mode
49- start :
45+ start : # # Start LocalStack in detached mode
5046 @echo " Starting LocalStack..."
5147 @LOCALSTACK_AUTH_TOKEN=$(LOCALSTACK_AUTH_TOKEN ) localstack start -d
5248 @echo " LocalStack started successfully."
5349
54- # # Stop the Running LocalStack container
55- stop :
50+ stop : # # Stop LocalStack
5651 @echo " Stopping LocalStack..."
5752 @localstack stop
5853 @echo " LocalStack stopped successfully."
5954
60- # # Make sure the LocalStack container is up
61- ready :
55+ ready : # # Wait for LocalStack to be ready
6256 @echo Waiting on the LocalStack container...
6357 @localstack wait -t 30 && echo LocalStack is ready to use! || (echo Gave up waiting on LocalStack, exiting. && exit 1)
6458
65- # # Save the logs in a separate file
66- logs :
59+ logs : # # Get LocalStack logs
6760 @localstack logs > logs.txt
6861
6962.PHONY : usage check start ready install deploy test logs stop
0 commit comments