From 687163e09a1187645f5717435ce6f7ddb472b580 Mon Sep 17 00:00:00 2001 From: Yuval Adam <_@yuv.al> Date: Tue, 17 Dec 2019 14:36:48 +0200 Subject: Prepare for deploy --- README.md | 11 +++++++++++ cron/.gitignore | 2 ++ cron/serverless.yml | 5 ++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b70ac19..c512e13 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,19 @@ Deployment is handled transparently via Netlify. ### Cron Task +#### Dev + +```bash +$ cd cron +$ python -m venv venv +$ source venv/bin/activate +$ pip install requests-ntlm +``` + #### Deploy +The `venv` must be populated with packages before deployment, then: + ```bash $ yarn run deploycron ``` diff --git a/cron/.gitignore b/cron/.gitignore index 22e4d37..0965ab7 100644 --- a/cron/.gitignore +++ b/cron/.gitignore @@ -1,6 +1,7 @@ # Distribution / packaging .Python env/ +venv/ build/ develop-eggs/ dist/ @@ -15,6 +16,7 @@ var/ *.egg-info/ .installed.cfg *.egg +.env __pycache__ *.pyc diff --git a/cron/serverless.yml b/cron/serverless.yml index e2d8764..bc913ca 100644 --- a/cron/serverless.yml +++ b/cron/serverless.yml @@ -2,7 +2,7 @@ service: cron provider: name: aws - runtime: python3.7 + runtime: python3.8 region: eu-west-1 memorySize: 128 timeout: 20 @@ -19,3 +19,6 @@ functions: handler: handler.update events: - schedule: rate(1 minute) + package: + include: + - venv/lib/python3.8/site-packages/** -- cgit v1.3.1