forked from karl-gustav/power_price
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
31 lines (30 loc) · 830 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
GPC_PROJECT_ID=my-cloud-collection
SERVICE_NAME=power-price
CONTAINER_NAME=eu.gcr.io/$(GPC_PROJECT_ID)/$(SERVICE_NAME)
run: build
docker run -p 8080:8080 $(CONTAINER_NAME)
build: test
docker build -t $(CONTAINER_NAME) .
push: build
docker push $(CONTAINER_NAME)
deploy: login-lpass push
gcloud run deploy $(SERVICE_NAME)\
--project $(GPC_PROJECT_ID)\
--allow-unauthenticated\
-q\
--region europe-west1\
--platform managed\
--set-env-vars SECURITY_TOKEN=$$(lpass show entsoe.eu --field=web-api-security-token)\
--memory 128Mi\
--image $(CONTAINER_NAME)
# add --no-traffic to not use latest version
use-latest-version:
gcloud run services update-traffic $(SERVICE_NAME)\
--to-latest\
--project $(GPC_PROJECT_ID)\
--region europe-west1\
--platform managed
login-lpass:
lpass sync
test:
go test ./...