-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
492 additions
and
9,069 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,7 @@ | ||
export AWS_ACCESS_KEY_ID ?= test | ||
export AWS_SECRET_ACCESS_KEY ?= test | ||
export AWS_DEFAULT_REGION=us-east-1 | ||
|
||
usage: ## Show this help | ||
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//' | ||
|
||
install: ## Install dependencies | ||
@npm install | ||
@which serverless || npm install -g serverless | ||
@which localstack || pip install localstack | ||
@which awslocal || pip install awscli-local | ||
|
||
run: ## Deploy the app locally and run a Lambda test invocation | ||
echo "Deploying Serverless app to local environment"; \ | ||
SLS_DEBUG=1 npm run deploy && \ | ||
echo "Serverless app successfully deployed. Now invoking the Lambda function to generate XRay traces." && \ | ||
awslocal lambda invoke --function-name test-xray-local-hello /tmp/out.tmp; \ | ||
TIME=$$(date +%s); \ | ||
ID=$$(awslocal xray get-trace-summaries --start-time $$(($$TIME-120)) --end-time $$TIME | jq -r '.TraceSummaries[0].Id'); \ | ||
awslocal xray batch-get-traces --trace-ids $$ID | ||
|
||
start: | ||
localstack start -d | ||
|
||
stop: | ||
@echo | ||
localstack stop | ||
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) | ||
|
||
logs: | ||
@localstack logs > logs.txt | ||
for-each-dir: | ||
../make-for-each.sh $$MAKE_TARGET $$CMD | ||
|
||
test-ci: | ||
make start install ready run; return_code=`echo $$?`;\ | ||
make logs; make stop; exit $$return_code; | ||
|
||
.PHONY: usage install start run stop ready logs test-ci | ||
MAKE_TARGET='test-ci' make for-each-dir | ||
|
||
.PHONY: for-each-dir test-ci |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.