Skip to content

Commit

Permalink
[Sync] 17961 (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
panther-bot authored Mar 19, 2024
1 parent 0ac2299 commit 93a886e
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions serverless/Makefile
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 93a886e

Please sign in to comment.