Skip to content

Commit

Permalink
Added usage and build targets to Makefile, updated readme and python …
Browse files Browse the repository at this point in the history
…requirements file
  • Loading branch information
Anastasia D. committed Oct 21, 2024
1 parent d827827 commit e7804cf
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
22 changes: 14 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,35 @@ SHELL := /bin/bash

include .env

build:
bin/build_lambdas.sh;
usage: ## Show this help
@grep -F -h "##" $(MAKEFILE_LIST) | grep -F -v grep -F | sed -e 's/\\$$//' -e 's/##//'

awslocal-setup:
install: ## Install dependencies
@pip install -r requirements-dev.txt

build: ## Build lambdas in the lambdas folder
bin/build_lambdas.sh;

awslocal-setup: ## Deploy the application locally using `awslocal`, a wrapper for the AWS CLI
$(MAKE) build
deployment/awslocal/deploy.sh

terraform-setup:
terraform-setup: ## Deploy the application locally using `tflocal`, a wrapper for Terraform CLI
$(MAKE) build
cd deployment/terraform; \
tflocal init; \
echo "Deploying Terraform configuration 🚀"; \
tflocal apply --auto-approve -var="local_run=${LOCAL_RUN}"; \
echo "Paste the function URLs above to the WebApp 🎉";

terraform-destroy:
terraform-destroy: ## Destroy all resources created locally using terraform scripts
cd deployment/terraform; \
tflocal destroy --auto-approve;

start:
start: ## Start the LocalStack Pro container in the detached mode
@LOCALSTACK_AUTH_TOKEN=$(LOCALSTACK_AUTH_TOKEN) localstack start -d

stop:
stop: ## Stop the LocalStack Pro container
localstack stop

.PHONY: build awslocal-setup terraform-setup terraform-destroy start stop
.PHONY: usage install build awslocal-setup terraform-setup terraform-destroy start stop
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,11 @@ pip install -r requirements-dev.txt

## Instructions

You can set up and deploy the sample application on LocalStack by executing the commands in our Makefile. First, create a `.env` file using the provided `.env.example` file as a template, and include your LocalStack token in it. Then, run `make start` to initiate LocalStack on your machine.
You can set up and deploy the sample application on LocalStack by executing the commands in our Makefile. First, create a `.env` file using the provided `.env.example` file as a template, and include your LocalStack token in it. Then, run `make start` to initiate LocalStack on your machine.

Next, execute `make terraform-setup` to provision the infrastructure on LocalStack using Terraform CLI and its scripts. Alternatively, run `make awslocal-setup` to set up the infrastructure with the local AWS CLI.
Next, execute `make install` to install needed dependencies.

After that, launch `make terraform-setup` to provision the infrastructure on LocalStack using Terraform CLI and its scripts. Alternatively, run `make awslocal-setup` to set up the infrastructure using `awslocal`, a wrapper for the AWS CLI.

If you prefer, you can also follow these step-by-step instructions for a manual deployment.

Expand All @@ -99,9 +101,7 @@ We are using the `tflocal` wrapper to configure the local service endpoints, and

### AWS CLI

You can execute the following commands to set up the infrastructure using `awslocal`, a wrapper for the AWS CLI.

All the commands are also available in the `deployment/awslocal/deploy.sh` script.
You can execute the following commands to set up the infrastructure using `awslocal`. All the commands are also available in the `deployment/awslocal/deploy.sh` script.

#### Create the buckets

Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ black
pytest
awscli
awscli-local
terraform-local

0 comments on commit e7804cf

Please sign in to comment.