-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
57 lines (41 loc) · 1.61 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
include .env
####################################################################################################################
# Auto formatting, type checks, & Lint checks
format:
python -m black -S --line-length 79 .
isort:
isort .
lint:
flake8 ./flows
lint-and-format: isort format lint
####################################################################################################################
# Prefect
prefect-cloud-login:
(\
prefect cloud login -k $(PREFECT_KEY)\
)
prefect-cloud-logout:
prefect cloud logout
prefect-api-url:
(\
make prefect-cloud-login &&\
prefect cloud workspace set --workspace $(PREFECT_WORKSPACE) &&\
prefect config view &&\
make prefect-cloud-logout\
)
####################################################################################################################
# Google Cloud
service-account:
gcloud iam service-accounts create $(GCP_SERVICE_ACCOUNT_NAME) --display-name="Terraform Service Account"
service-account-permissions:
gcloud projects add-iam-policy-binding $(GCP_PROJECT_ID) --member='serviceAccount:$(GCP_SERVICE_ACCOUNT_NAME)@$(GCP_PROJECT_ID).iam.gserviceaccount.com' --role='roles/editor'
download-api-key:
gcloud iam service-accounts keys create $(LOCAL_SERVICE_ACCOUNT_FILE_PATH) --iam-account=$(GCP_SERVICE_ACCOUNT_NAME)@$(GCP_PROJECT_ID).iam.gserviceaccount.com
enable-apis:
gcloud services enable iam.googleapis.com \
compute.googleapis.com \
bigquery.googleapis.com \
run.googleapis.com \
artifactregistry.googleapis.com
gcp-setup:
make enable-apis && make service-account && make service-account-permissions && make download-api-key