-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
36 lines (26 loc) · 964 Bytes
/
Makefile
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
cloud_fn_config := --runtime "python37" --trigger-topic weekly-cron-topic --env-vars-file .env.yaml --max-instances 1 --timeout=480s
.PHONY: lint deploy deploy-http cron-job cron-topic bucket
# Dev targets
lint: main.py
flake8 . --count --max-complexity=10 --statistics
# Deploy targets
deploy: main.py requirements.txt .env.yaml
gcloud pubsub topics describe weekly-cron-topic
gcloud functions deploy "podcast-transcriber-cron" \
--entry-point "topic_main" \
$(cloud_fn_config)
deploy-http: main.py requirements.txt .env.yaml
gcloud functions deploy "podcast-transcriber" \
--entry-point "http_main" \
$(cloud_fn_config)
# One-time infra initialization targets
cron-job: cron-topic
gcloud scheduler jobs create pubsub WeeklyJob \
--schedule="0 9 * * 1" \
--topic="weekly-cron-topic" \
--message-body="" \
--attributes="src=WeeklyJob"
cron-topic:
gcloud pubsub topics create weekly-cron-topic
bucket:
gsutil mb gs://transcriptions