-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (39 loc) · 1.15 KB
/
Copy pathMakefile
File metadata and controls
50 lines (39 loc) · 1.15 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
44
45
46
47
48
49
50
include config.mk
DOCKER_IMAGE := $(LOCATION)-docker.pkg.dev/$(PROJECT)/docker/$(NAME)
.PHONY: docker-build
docker-build:
docker build -t $(DOCKER_IMAGE) .
.PHONY: docker-run
docker-run:
docker run -p 80:80 $(DOCKER_IMAGE)
.PHONY: docker-push
docker-push:
docker push $(DOCKER_IMAGE)
.PHONY: cloud-run
cloud-run:
gcloud run deploy $(NAME) \
--project $(PROJECT) \
--region $(LOCATION) \
--image $(DOCKER_IMAGE) \
--max-instances 10 \
--port 80
.PHONY: cloud-build
cloud-build:
gcloud builds submit --project $(PROJECT) --tag $(DOCKER_IMAGE)
.PHONY: terraform-tfvars
terraform-tfvars:
touch terraform/terraform.tfvars
echo hello > terraform/terraform.tfvars
echo project = \"$(PROJECT)\" > terraform/terraform.tfvars
echo name = \"$(NAME)\" >> terraform/terraform.tfvars
echo location = \"$(LOCATION)\" >> terraform/terraform.tfvars
echo domain = \"$(DOMAIN)\" >> terraform/terraform.tfvars
.PHONY: terraform-init
terraform-init:
cd terraform && terraform init
.PHONY: terraform-plan
terraform-plan: terraform-tfvars
cd terraform && terraform plan
.PHONY: terraform-apply
terraform-apply: terraform-tfvars
cd terraform && terraform apply