-
Notifications
You must be signed in to change notification settings - Fork 11
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
1 parent
0ac2299
commit 93a886e
Showing
1 changed file
with
9 additions
and
7 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,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" |