Skip to content

Improve the makefile setup #1597

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 27, 2023
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
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SUBCLEAN = $(addsuffix .clean,$(COMPONENTS))
SUBINITIALIZE = $(addsuffix .initialize,$(COMPONENTS))

.PHONY: clean $(SUBCLEAN)
clean: $(SUBCLEAN)
clean: stop-docker $(SUBCLEAN)
$(SUBCLEAN): %.clean:
$(MAKE) -C $* clean

Expand All @@ -30,8 +30,13 @@ start-docker-kms:
docker start async_aws_kms && exit 0 || \
docker run -d -p 4579:8080 --name async_aws_kms nsmithuk/local-kms

stop-docker: clean
stop-docker:
docker stop async_aws_localstack || true
docker rm async_aws_localstack || true
docker stop async_aws_s3 || true
docker rm async_aws_s3 || true
docker stop async_aws_kms || true
docker rm async_aws_kms || true

test: initialize
./vendor/bin/simple-phpunit
Expand Down
1 change: 1 addition & 0 deletions src/Core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ test: initialize
clean: stop-docker
stop-docker:
docker stop async_aws_localstack-sts || true
docker rm async_aws_localstack-sts || true
1 change: 1 addition & 0 deletions src/Service/CloudFormation/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ test: initialize
clean: stop-docker
stop-docker:
docker stop async_aws_localstack-cloudformation || true
docker rm async_aws_localstack-cloudformation || true
1 change: 1 addition & 0 deletions src/Service/CloudWatchLogs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ test: initialize
clean: stop-docker
stop-docker:
docker stop async_aws_localstack-logs || true
docker rm async_aws_localstack-logs || true
1 change: 1 addition & 0 deletions src/Service/DynamoDb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ test: initialize
clean: stop-docker
stop-docker:
docker stop async_aws_localstack-dynamodb || true
docker rm async_aws_localstack-dynamodb || true
1 change: 1 addition & 0 deletions src/Service/EventBridge/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ test: initialize
clean: stop-docker
stop-docker:
docker stop async_aws_localstack-events || true
docker rm async_aws_localstack-events || true
1 change: 1 addition & 0 deletions src/Service/Iam/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ test: initialize
clean: stop-docker
stop-docker:
docker stop async_aws_localstack-iam || true
docker rm async_aws_localstack-iam || true
1 change: 1 addition & 0 deletions src/Service/Kinesis/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ test: initialize
clean: stop-docker
stop-docker:
docker stop async_aws_localstack-kinesis || true
docker rm async_aws_localstack-kinesis || true
5 changes: 3 additions & 2 deletions src/Service/Kms/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

initialize: start-docker
start-docker:
docker start async_aws_localstack && exit 0 || \
docker start async_aws_kms && exit 0 || \
docker start async_aws_localstack-kms && exit 0 || \
docker pull localstack/localstack:0.14.2 && \
docker pull nsmithuk/local-kms && \
docker run -d -p 4579:8080 --name async_aws_localstack-kms nsmithuk/local-kms && \
docker run --rm --link async_aws_localstack-kms:localstack martin/wait -c localstack:8080

Expand All @@ -14,3 +14,4 @@ test: initialize
clean: stop-docker
stop-docker:
docker stop async_aws_localstack-kms || true
docker rm async_aws_localstack-kms || true
3 changes: 2 additions & 1 deletion src/Service/Lambda/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
initialize: start-docker
start-docker:
docker start async_aws_lambda && exit 0 || \
docker pull lambci/lambda && \
docker pull lambci/lambda:nodejs12.x && \
docker run -d -p 9001:9001 -e DOCKER_LAMBDA_STAY_OPEN=1 -v "$(ROOT_DIR)/tests/fixtures/lambda":/var/task:ro,delegated --name async_aws_lambda lambci/lambda:nodejs12.x index.handler

test: initialize
Expand All @@ -14,3 +14,4 @@ test: initialize
clean: stop-docker
stop-docker:
docker stop async_aws_lambda || true
docker rm async_aws_lambda || true
1 change: 1 addition & 0 deletions src/Service/Route53/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ test: initialize
clean: stop-docker
stop-docker:
docker stop async_aws_localstack-route53 || true
docker rm async_aws_localstack-route53 || true
1 change: 1 addition & 0 deletions src/Service/S3/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ test: initialize
clean: stop-docker
stop-docker:
docker stop async_aws_s3-client || true
docker rm async_aws_s3-client || true
2 changes: 1 addition & 1 deletion src/Service/SecretsManager/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ test: initialize
clean: stop-docker
stop-docker:
docker stop async_aws_localstack-secretsmanager || true

docker rm async_aws_localstack-secretsmanager || true
1 change: 1 addition & 0 deletions src/Service/Sns/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ test: initialize
clean: stop-docker
stop-docker:
docker stop async_aws_localstack-sns || true
docker rm async_aws_localstack-sns || true
1 change: 1 addition & 0 deletions src/Service/Sqs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ test: initialize
clean: stop-docker
stop-docker:
docker stop async_aws_sqs || true
docker rm async_aws_sqs || true
1 change: 1 addition & 0 deletions src/Service/Ssm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ test: initialize
clean: stop-docker
stop-docker:
docker stop async_aws_localstack-ssm || true
docker rm async_aws_localstack-ssm || true