Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/cloud-pods.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ jobs:
run: |
make install

- name: Install CDK
run: |
npm install -g aws-cdk-local aws-cdk
cdklocal --version

- name: Start LocalStack
uses: LocalStack/setup-localstack@main
with:
Expand All @@ -47,8 +52,6 @@ jobs:
AWS_SECRET_ACCESS_KEY: test
AWS_DEFAULT_REGION: us-east-1
run: |
make build
make bootstrap
make deploy

- name: Create Cloud Pod
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ jobs:
run: |
make install

- name: Install CDK
run: |
npm install -g aws-cdk-local aws-cdk
cdklocal --version

- name: Start LocalStack
uses: LocalStack/setup-localstack@v0.2.4
with:
Expand All @@ -48,8 +53,6 @@ jobs:
AWS_SECRET_ACCESS_KEY: test
AWS_DEFAULT_REGION: us-east-1
run: |
make build
make bootstrap
make deploy

- name: Integration Tests
Expand Down
55 changes: 39 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,63 @@ SHELL := /bin/bash
usage:
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'

## Check if all required prerequisites are installed
check:
@command -v docker > /dev/null 2>&1 || { echo "Docker is not installed. Please install Docker and try again."; exit 1; }
@command -v node > /dev/null 2>&1 || { echo "Node.js is not installed. Please install Node.js and try again."; exit 1; }
@command -v aws > /dev/null 2>&1 || { echo "AWS CLI is not installed. Please install AWS CLI and try again."; exit 1; }
@command -v localstack > /dev/null 2>&1 || { echo "LocalStack is not installed. Please install LocalStack and try again."; exit 1; }
@command -v cdk > /dev/null 2>&1 || { echo "CDK is not installed. Please install CDK and try again."; exit 1; }
@command -v cdklocal > /dev/null 2>&1 || { echo "cdklocal is not installed. Please install cdklocal and try again."; exit 1; }
@command -v aws > /dev/null 2>&1 || { echo "AWS CLI is not installed. Please install AWS CLI and try again."; exit 1; }
@command -v awslocal > /dev/null 2>&1 || { echo "awslocal is not installed. Please install awslocal and try again."; exit 1; }
@echo "All required prerequisites are available."

## Install dependencies
install:
@which localstack || pip install localstack
@which awslocal || pip install awscli-local
@which cdklocal || npm install -g aws-cdk-local aws-cdk
@if [ ! -d "node_modules" ]; then \
echo "node_modules not found. Running npm install..."; \
npm install; \
fi
@if [ ! -d "demos/rds-query-fn-code/node_modules" ]; then \
echo "demos/rds-query-fn-code/node_modules not found. Running npm install..."; \
npm install --prefix demos/rds-query-fn-code; \
fi
@echo "All required dependencies are available."

## Deploy the infrastructure
build:
npm install && cd demos/rds-query-fn-code && npm install

## Bootstap the CDK sample
bootstrap:
cdklocal bootstrap

## Deploy the CDK sample
deploy:
@echo "Bootstrapping CDK..."
cdklocal bootstrap
@echo "Deploying CDK..."
cdklocal deploy --require-approval never
@echo "CDK deployed successfully."

## Run the tests
test:
@echo "Running tests..."
npm test
@echo "Tests completed successfully."

## Start LocalStack in detached mode
start:
RDS_MYSQL_DOCKER=1 localstack start -d
@echo "Starting LocalStack..."
@LOCALSTACK_AUTH_TOKEN=$(LOCALSTACK_AUTH_TOKEN) localstack start -d
@echo "LocalStack started successfully."

## Stop the Running LocalStack container
stop:
@echo
localstack stop
@echo "Stopping LocalStack..."
@localstack stop
@echo "LocalStack stopped successfully."

## Make sure the LocalStack container is up
ready:
@echo Waiting on the LocalStack container...
@localstack wait -t 30 && echo LocalStack is ready to use! || (echo Gave up waiting on LocalStack, exiting. && exit 1)

## Save the logs in a separate file, since the LS container will only contain the logs of the last sample run.
## Save the logs in a separate file
logs:
@localstack logs > logs.txt

.PHONY: usage install bootstrap build deploy deploy start stop ready logs
.PHONY: usage check start ready install deploy test logs stop