-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (34 loc) · 1.58 KB
/
Copy pathMakefile
File metadata and controls
44 lines (34 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
init-env:
brew install pyenv pyenv-virtualenv
eval "$(pyenv init-)"
eval "$(pyenv virtualenv-init -)";
export PATH="$HOME/.pyenv/bin:$PATH"
pyenv install 3.9
pyenv virtualenv 3.9 cuya-courts
env:
pyenv activate cuya-courts
init-db:
python scripts/init_db.py
image-local:
docker build -t case-scrape-local .
docker run --env-file .env -p 9000:8080 case-scrape-local:latest
image-local-debug:
echo "" >> requirements.txt && echo "debugpy" >> requirements.txt
docker build -t case-scrape-local .
sed -i '' '/debugpy/d' requirements.txt
docker run --env-file .env -p 9000:8080 -p 5890:5890 -e DEBUGPY=true case-scrape-local:latest
debug-event:
curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" --max-time 900 -d '{"case_number":"602708"}'
update-ecr-image:
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 952753501735.dkr.ecr.us-east-1.amazonaws.com
docker build -t case-scrape .
docker tag case-scrape:latest 952753501735.dkr.ecr.us-east-1.amazonaws.com/case-scrape:latest
docker push 952753501735.dkr.ecr.us-east-1.amazonaws.com/case-scrape:latest
clean:
docker stop case-scrape-local || true
docker rm case-scrape-local || true
docker rmi case-scrape-local:latest || true
update-lambda:
aws lambda update-function-code --function-name criminal_case_scrape --image-uri 952753501735.dkr.ecr.us-east-1.amazonaws.com/case-scrape:latest
pg-dump-from-aws:
pg_dump -Z 9 -v -h ${DATABASE_HOST} -U ${DATABASE_USER} -d ${DATABASE_NAME} | aws s3 cp --storage-class STANDARD --sse aws:kms - s3://my-bucket/dump.sql.gz