forked from openware/barong
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
28 lines (21 loc) · 818 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
VERSION ?= $(shell cat VERSION)
ENV ?= staging
SERVICE := barong
IMAGE := rubykube/$(SERVICE):$(VERSION)
CURRENT_CONTEXT := $(shell kubectl config current-context)
.PHONY: default build push run deploy
default: build run
build:
@echo '> Using ENV: $(ENV) and context: $(CURRENT_CONTEXT)'
@echo '> Building "$(SERVICE)" docker image...'
@docker build -t $(IMAGE) .
push: build
@docker push $(IMAGE)
run:
@echo '> Starting "$(SERVICE)" container...'
@docker run -d --name=database -e MYSQL_ALLOW_EMPTY_PASSWORD=true -p 13306:13306 mysql
@docker run --link=database -e DATABASE_HOST=database -p 3000:3000 -d $(IMAGE)
deploy:
@helm install --name $(SERVICE) config/charts/$(SERVICE) --set="image.tag=$(VERSION)"
upgrade:
@helm upgrade $(SERVICE) config/charts/$(SERVICE) --set="image.tag=$(VERSION)"