Skip to content

Commit

Permalink
docs: imrpove docs and makefile (#15)
Browse files Browse the repository at this point in the history
Co-authored-by: Ran Isenberg <[email protected]>
  • Loading branch information
ran-isenberg and Ran Isenberg authored May 20, 2023
1 parent b947dd0 commit fc80942
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 16 deletions.
17 changes: 5 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,16 @@ Follow the cookiecutter questions:
![logo](https://github.com/ran-isenberg/cookiecutter-serverless-python/blob/main/media/howto.png?raw=true)
<br></br>

Now, let's setup git for your new shiny projct:

```
cd {new repo folder}
git init
```


Now you can create your developer environment and deploy to AWS. Run the following commands:
### **That's it, your developer environment has been set! you are ready to deploy the service:**

```
make dev
poetry install
make pr
cd {new repo folder}
poetry shell
make deploy
```

'Make pr' will run all checks, synth, file formatters , unit tests, deploy to AWS and run integration and E2E tests.
You can also run 'make pr' will run all checks, synth, file formatters , unit tests, deploy to AWS and run integration and E2E tests.


For more information head over to project documentation pages at [https://ran-isenberg.github.io/aws-lambda-handler-cookbook](https://ran-isenberg.github.io/aws-lambda-handler-cookbook/)
Expand Down
21 changes: 21 additions & 0 deletions hooks/post_gen_project.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
import os
from pathlib import Path
import subprocess

def main():
print("Running 'git init'")
subprocess.run(['git', 'init'], check=True)

print("Running 'pip install --upgrade pip pre-commit poetry'")
subprocess.run(['pip', 'install', '--upgrade', 'pip', 'pre-commit', 'poetry'], check=True)

print("Running 'pre-commit install'")

subprocess.run(['pre-commit', 'install'], check=True)

print("Running 'poetry config --local virtualenvs.in-project true'")
subprocess.run(['poetry', 'config', '--local', 'virtualenvs.in-project', 'true'], check=True)

print("Running 'poetry install'")
subprocess.run(['poetry', 'install'], check=True)

print("Project successfully initialized")
return

if __name__ == "__main__":
main()
4 changes: 2 additions & 2 deletions {{cookiecutter.repo_name}}/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

dev:
pip install --upgrade pip pre-commit poetry
make deps
pre-commit install
poetry shell
poetry config --local virtualenvs.in-project true
poetry install

lint:
@echo "Running flake8"
Expand Down
4 changes: 2 additions & 2 deletions {{cookiecutter.repo_name}}/Makefile_windows
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

dev:
pip install --upgrade pip pre-commit poetry
make deps
pre-commit install
poetry shell
poetry config --local virtualenvs.in-project true
poetry install

lint:
@echo "Running flake8"
Expand Down

0 comments on commit fc80942

Please sign in to comment.