2016-03-02 15:50:50 +00:00
|
|
|
REBAR := $(shell which rebar3 2>/dev/null || which ./rebar3)
|
2016-08-08 18:16:17 +00:00
|
|
|
SUBMODULES = apps/hg_proto/damsel build_utils
|
2016-06-15 16:10:22 +00:00
|
|
|
SUBTARGETS = $(patsubst %,%/.git,$(SUBMODULES))
|
2016-03-02 15:50:50 +00:00
|
|
|
|
2016-08-12 12:40:18 +00:00
|
|
|
UTILS_PATH := build_utils
|
2016-08-08 18:16:17 +00:00
|
|
|
TEMPLATES_PATH := .
|
2016-03-02 15:50:50 +00:00
|
|
|
|
2016-08-08 18:16:17 +00:00
|
|
|
# Name of the service
|
|
|
|
SERVICE_NAME := hellgate
|
|
|
|
# Service image default tag
|
|
|
|
SERVICE_IMAGE_TAG ?= $(shell git rev-parse HEAD)
|
|
|
|
# The tag for service image to be pushed with
|
|
|
|
SERVICE_IMAGE_PUSH_TAG ?= $(SERVICE_IMAGE_TAG)
|
2016-03-02 15:50:50 +00:00
|
|
|
|
2016-08-08 18:16:17 +00:00
|
|
|
# Base image for the service
|
|
|
|
BASE_IMAGE_NAME := service_erlang
|
2016-10-11 14:36:35 +00:00
|
|
|
BASE_IMAGE_TAG := 4000337c0ca19978467f62ca6505a03c2569de40
|
2016-06-29 13:58:48 +00:00
|
|
|
|
2016-08-08 18:16:17 +00:00
|
|
|
# Build image tag to be used
|
2016-10-12 07:20:22 +00:00
|
|
|
BUILD_IMAGE_TAG := 80c38dc638c0879687f6661f4e16e8de9fc0d2c6
|
2016-08-08 18:16:17 +00:00
|
|
|
|
|
|
|
CALL_ANYWHERE := all submodules rebar-update compile xref lint dialyze start devrel release clean distclean
|
2016-06-29 13:58:48 +00:00
|
|
|
|
|
|
|
CALL_W_CONTAINER := $(CALL_ANYWHERE) test
|
2016-03-02 15:50:50 +00:00
|
|
|
|
2016-08-08 18:16:17 +00:00
|
|
|
all: compile
|
|
|
|
|
2016-08-12 12:40:18 +00:00
|
|
|
-include $(UTILS_PATH)/make_lib/utils_container.mk
|
|
|
|
-include $(UTILS_PATH)/make_lib/utils_image.mk
|
2016-06-29 13:58:48 +00:00
|
|
|
|
2016-08-08 18:16:17 +00:00
|
|
|
.PHONY: $(CALL_W_CONTAINER)
|
2016-06-29 13:58:48 +00:00
|
|
|
|
|
|
|
# CALL_ANYWHERE
|
2016-06-15 16:10:22 +00:00
|
|
|
$(SUBTARGETS): %/.git: %
|
|
|
|
git submodule update --init $<
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
submodules: $(SUBTARGETS)
|
|
|
|
|
2016-06-29 13:58:48 +00:00
|
|
|
rebar-update:
|
|
|
|
$(REBAR) update
|
|
|
|
|
|
|
|
compile: submodules rebar-update
|
2016-06-15 16:10:22 +00:00
|
|
|
$(REBAR) compile
|
|
|
|
|
2016-06-29 13:58:48 +00:00
|
|
|
xref: submodules
|
|
|
|
$(REBAR) xref
|
|
|
|
|
2016-08-11 15:52:58 +00:00
|
|
|
lint:
|
2016-06-29 13:58:48 +00:00
|
|
|
elvis rock
|
|
|
|
|
|
|
|
dialyze:
|
|
|
|
$(REBAR) dialyzer
|
2016-03-02 15:50:50 +00:00
|
|
|
|
2016-06-15 16:10:22 +00:00
|
|
|
start: submodules
|
2016-04-07 11:37:34 +00:00
|
|
|
$(REBAR) run
|
2016-03-02 15:50:50 +00:00
|
|
|
|
2016-06-29 13:58:48 +00:00
|
|
|
devrel: submodules
|
|
|
|
$(REBAR) release
|
2016-06-15 16:10:22 +00:00
|
|
|
|
2016-06-29 13:58:48 +00:00
|
|
|
release: distclean
|
|
|
|
$(REBAR) as prod release
|
2016-03-02 15:50:50 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
$(REBAR) clean
|
|
|
|
|
|
|
|
distclean:
|
|
|
|
$(REBAR) clean -a
|
|
|
|
rm -rfv _build _builds _cache _steps _temp
|
|
|
|
|
2016-06-29 13:58:48 +00:00
|
|
|
# CALL_W_CONTAINER
|
|
|
|
test: submodules
|
|
|
|
$(REBAR) ct
|
2016-06-15 16:10:22 +00:00
|
|
|
|