Skip to content

Commit 4c520a0

Browse files
authored
Add Makefile and upgrade workflow actions (#2)
* Add Makefile and upgrade workflow actions * Fix README: remove LocalStack Pro, add license bullet; restore keepalive in workflow * Update README.md
1 parent ce5f159 commit 4c520a0

File tree

3 files changed

+39
-5
lines changed

3 files changed

+39
-5
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: Checkout
24-
uses: actions/checkout@v3
24+
uses: actions/checkout@v4
2525

2626
- uses: gautamkrishnar/keepalive-workflow@v1
2727

2828
- name: Setup Node.js
29-
uses: actions/setup-node@v3
29+
uses: actions/setup-node@v4
3030
with:
3131
node-version: 18
3232

@@ -46,7 +46,7 @@ jobs:
4646
4747
- name: Start LocalStack
4848
env:
49-
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
49+
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
5050
run: |
5151
pip install localstack awscli-local[ver1]
5252
docker pull localstack/localstack-pro:latest

Makefile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
export AWS_ACCESS_KEY_ID ?= test
2+
export AWS_SECRET_ACCESS_KEY ?= test
3+
export AWS_DEFAULT_REGION=us-east-1
4+
SHELL := /bin/bash
5+
6+
usage: ## Show this help
7+
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
8+
9+
install: ## Install dependencies
10+
@which localstack || pip install localstack
11+
@which awslocal || pip install awscli-local
12+
virtualenv env
13+
. env/bin/activate && pip install -r requirements.txt
14+
15+
start: ## Start LocalStack
16+
@test -n "${LOCALSTACK_AUTH_TOKEN}" || (echo "LOCALSTACK_AUTH_TOKEN is not set. Find your token at https://app.localstack.cloud/workspace/auth-token"; exit 1)
17+
@LOCALSTACK_AUTH_TOKEN=$(LOCALSTACK_AUTH_TOKEN) localstack start -d
18+
19+
stop: ## Stop LocalStack
20+
@localstack stop
21+
22+
ready: ## Wait until LocalStack is ready
23+
@echo Waiting on the LocalStack container...
24+
@localstack wait -t 30 && echo LocalStack is ready to use! || (echo Gave up waiting on LocalStack, exiting. && exit 1)
25+
26+
logs: ## Save the logs in a separate file
27+
@localstack logs > logs.txt
28+
29+
deploy: ## Deploy the CDK stack
30+
cdklocal bootstrap
31+
cdklocal deploy --require-approval never
32+
33+
.PHONY: usage install start stop ready logs deploy

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@ The sample code in this repository demonstrates how to use the ECS Code Mounting
1919

2020
## Prerequisites
2121

22-
- LocalStack Pro with the [`localstack` CLI](https://docs.localstack.cloud/getting-started/installation/#localstack-cli).
22+
- A valid [LocalStack for AWS license](https://localstack.cloud/pricing). Your license provides a [`LOCALSTACK_AUTH_TOKEN`](https://docs.localstack.cloud/getting-started/auth-token/) to activate LocalStack.
23+
- [`localstack` CLI](https://docs.localstack.cloud/getting-started/installation/#localstack-cli).
2324
- [Cloud Development Kit](https://docs.localstack.cloud/user-guide/integrations/aws-cdk/) with the [`cdklocal`](https://www.npmjs.com/package/aws-cdk-local) installed.
2425
- [Python 3.9+](https://www.python.org/downloads/) & `pip` package manager.
2526
- [`virtualenv`](https://pypi.org/project/virtualenv/) for creating isolated Python environments.
2627
- `cURL` or any other tool to send HTTP requests.
2728

28-
Start LocalStack Pro with the `LOCALSTACK_AUTH_TOKEN` pre-configured:
29+
Start LocalStack with the `LOCALSTACK_AUTH_TOKEN` pre-configured:
2930

3031
```shell
3132
export LOCALSTACK_AUTH_TOKEN=<your-auth-token>

0 commit comments

Comments
 (0)