forked from sentry-demos/flask
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (27 loc) · 1.19 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
# Must have `sentry-cli` installed globally
# Following variable must be passed in:
#SENTRY_AUTH_TOKEN=<your_auth_token>
SENTRY_ORG=testorg-az
SENTRY_PROJECT=adamflasksampleapp
VERSION=`sentry-cli releases propose-version`
REPOSITORY=us.gcr.io/sales-engineering-sf
COMMIT_SHA=$(shell git rev-parse HEAD)
WHOAMI=$(shell whoami)
GCP_SERVICE_NAME=flask-errors
GCP_WORKSPACE_NAME=workspace_flask_errors
deploy: create_release associate_commits run_flask
create_release:
sentry-cli releases -o $(SENTRY_ORG) new -p $(SENTRY_PROJECT) $(VERSION)
# makes Sentry look at commits sitting on Sentry, and associates them to this Release that's getting pushed up
associate_commits:
sentry-cli releases -o $(SENTRY_ORG) -p $(SENTRY_PROJECT) set-commits --auto $(VERSION)
run_flask:
VERSION=$(VERSION) FLASK_APP=app.py flask run -p 3001
# GCP
deploy_gcp: build_image deploy_service
build_image:
gcloud builds submit --substitutions=COMMIT_SHA=$(COMMIT_SHA) --config=cloudbuild.yaml
deploy_service:
gcloud run deploy $(WHOAMI)-$(GCP_SERVICE_NAME) --image $(REPOSITORY)/$(GCP_WORKSPACE_NAME):$(COMMIT_SHA) --platform managed
# ---
.PHONY: deploy create_release associate_commits run_flask deploy_to_gcp build flask