-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
53 lines (43 loc) · 1.32 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
NAME=config-api
DEPLOYMENT=deployment/$(NAME)
GOCMD=go
GET_HASH=git rev-parse HEAD
HASH:=$(shell $(GET_HASH))
GCP_PROJECT=usermirror-staging
GCR_REPO=us.gcr.io/$(GCP_PROJECT)/$(NAME)
DOCKERHUB_ORG=usermirror
DOCKERHUB_IMAGE=$(DOCKERHUB_ORG)/$(NAME)
build:
@make docker-build docker-push
docker-build:
@echo "Building... ($(HASH))"
@docker build -t $(DOCKERHUB_IMAGE):$(HASH) -t $(DOCKERHUB_IMAGE):latest .
@docker tag $(DOCKERHUB_IMAGE):$(HASH) $(GCR_REPO):$(HASH)
@docker tag $(DOCKERHUB_IMAGE):$(HASH) $(GCR_REPO):latest
@echo "Built complete ($(HASH))"
docker-push:
@echo "🛫 Docker Hub · $(HASH)"
@docker push $(DOCKERHUB_IMAGE):$(HASH)
@echo "🛬 Docker Hub · $(DOCKERHUB_IMAGE):$(HASH)"
gcr-push:
@echo "🛫 GCR · $(HASH)"
@gcloud docker -- push $(GCR_REPO) > /dev/null
@echo "🛬 GCR · $(GCR_REPO):$(HASH)"
gcr-push-latest:
@echo "🛫 GCR · latest"
@gcloud docker -- push $(GCR_REPO):latest > /dev/null
@echo "🛬 GCR · $(GCR_REPO):latest"
rollout-status:
kubectl rollout status $(DEPLOYMENT)
rollout-history:
kubectl rollout history $(DEPLOYMENT)
deps:
go get -u github.com/codegangsta/gin
go get .
watch:
gin -p 4200 -a 8888 run cmd/config/main.go
check:
cd terraform && \
terraform init && \
terraform plan && \
terraform apply -auto-approve -target=module.config.template_dir.kube_manifests