From 93a886ef84f281a3547e7f2f69205ab85cf71f83 Mon Sep 17 00:00:00 2001 From: panther-bot <54194790+panther-bot@users.noreply.github.com> Date: Tue, 19 Mar 2024 07:58:23 -0500 Subject: [PATCH] [Sync] 17961 (#113) --- serverless/Makefile | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/serverless/Makefile b/serverless/Makefile index 9ed8d9b..849bc20 100644 --- a/serverless/Makefile +++ b/serverless/Makefile @@ -1,23 +1,25 @@ -.PHONY: test +.PHONY: iter publish setup clean test lint bucket = panther-public-sam-artifacts +finddir = find . -maxdepth 1 -mindepth 1 -type d +xargs = xargs -I % iter: - find . -depth 1 -type d | xargs -I % make -C % --makefile=../Makefile $(action) samdir=% + $(finddir) | $(xargs) make -C % --makefile=../Makefile $(action) samdir=% publish: sam build --use-container --build-image public.ecr.aws/sam/build-python3.11; sam package --s3-bucket $(bucket)-$(region) --output-template-file ../../cloudformation/$(samdir)-$(region).yml setup: - find . -depth 1 -type d | xargs -I % python3 -m venv %/venv - find . -depth 1 -type d | xargs -I % bash -c "%/venv/bin/pip install -r %/src/requirements.txt" - find . -depth 1 -type d | xargs -I % bash -c "%/venv/bin/pip install pytest pylint" + $(finddir) | $(xargs) python3 -m venv %/venv + $(finddir) | $(xargs) bash -c "%/venv/bin/pip install -r %/src/requirements.txt" + $(finddir) | $(xargs) bash -c "%/venv/bin/pip install pytest pylint" clean: rm -rf */venv test: - find . -depth 1 -type d | xargs -I % bash -c "pushd %; AWS_DEFAULT_REGION=us-west-2 venv/bin/pytest test/; popd" + $(finddir) | $(xargs) bash -c "pushd %; AWS_DEFAULT_REGION=us-west-2 venv/bin/pytest test/; popd" lint: - find . -depth 1 -type d | xargs -I % bash -c "pushd %; venv/bin/pylint -j 0 --max-line-length 140 --score no src/; popd" + $(finddir) | $(xargs) bash -c "pushd %; venv/bin/pylint -j 0 --max-line-length 140 --score no src/; popd"