-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
40 lines (28 loc) · 1.05 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
ES_VERSION ?= 6.5.1
SG_VERSION = $(shell cat es-versions.json | jq '.["$(ES_VERSION)"]')
CLOUD_PROVIDER ?= src/vendor_specific/gce
DOCKER_REPOSITORY ?= gcr.io
GENERATE_PASSWORDS ?= true
ifndef PROJECT_ID
$(error Please set PROJECT_ID to the name of GCE project)
endif
ifeq ($(SG_VERSION), null)
$(error ES Version $(ES_VERSION) not supported)
endif
IMAGE_NAME = $(DOCKER_REPOSITORY)/$(PROJECT_ID)/es-6-sg:$(ES_VERSION)
default: deploy
ifeq ($(strip $(SG_VERSION)),)
$(error Please install jq from https://stedolan.github.io/jq/)
endif
image_build:
@echo building docker image: es version $(ES_VERSION) , sg version $(SG_VERSION)
docker build --build-arg ES_VERSION=$(ES_VERSION) --build-arg SG_VERSION=$(SG_VERSION) -t $(IMAGE_NAME) .
image_push:
docker push $(IMAGE_NAME)
create_network:
cd $(CLOUD_PROVIDER); ./create-network.sh $(GENERATE_PASSWORDS)
create_cluster:
cd $(CLOUD_PROVIDER); ./create-cluster.sh $(IMAGE_NAME) $(GENERATE_PASSWORDS)
create_lb:
cd $(CLOUD_PROVIDER); ./create-lb.sh
deploy: image_build image_push create_network create_cluster