|
1 | | -export AWS_ACCESS_KEY_ID ?= test |
2 | | -export AWS_SECRET_ACCESS_KEY ?= test |
3 | | -export AWS_DEFAULT_REGION=us-east-1 |
4 | | - |
5 | | -usage: ## Show this help |
6 | | - @fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//' |
7 | | - |
8 | | -install: ## Install dependencies |
9 | | - @npm install |
10 | | - @which serverless || npm install -g serverless |
11 | | - @which localstack || pip install localstack |
12 | | - @which awslocal || pip install awscli-local |
13 | | - |
14 | | -run: ## Deploy the app locally and run a Lambda test invocation |
15 | | - echo "Deploying Serverless app to local environment"; \ |
16 | | - SLS_DEBUG=1 npm run deploy && \ |
17 | | - echo "Serverless app successfully deployed. Now invoking the Lambda function to generate XRay traces." && \ |
18 | | - awslocal lambda invoke --function-name test-xray-local-hello /tmp/out.tmp; \ |
19 | | - TIME=$$(date +%s); \ |
20 | | - ID=$$(awslocal xray get-trace-summaries --start-time $$(($$TIME-120)) --end-time $$TIME | jq -r '.TraceSummaries[0].Id'); \ |
21 | | - awslocal xray batch-get-traces --trace-ids $$ID |
22 | | - |
23 | | -start: |
24 | | - localstack start -d |
25 | | - |
26 | | -stop: |
27 | | - @echo |
28 | | - localstack stop |
29 | | -ready: |
30 | | - @echo Waiting on the LocalStack container... |
31 | | - @localstack wait -t 30 && echo Localstack is ready to use! || (echo Gave up waiting on LocalStack, exiting. && exit 1) |
32 | | - |
33 | | -logs: |
34 | | - @localstack logs > logs.txt |
| 1 | +for-each-dir: |
| 2 | + ../make-for-each.sh $$MAKE_TARGET $$CMD |
35 | 3 |
|
36 | 4 | test-ci: |
37 | | - make start install ready run; return_code=`echo $$?`;\ |
38 | | - make logs; make stop; exit $$return_code; |
39 | | - |
40 | | -.PHONY: usage install start run stop ready logs test-ci |
| 5 | + MAKE_TARGET='test-ci' make for-each-dir |
41 | 6 |
|
| 7 | +.PHONY: for-each-dir test-ci |
0 commit comments