2016-08-24 11:27:31 +00:00
|
|
|
REBAR := $(shell which rebar3 2>/dev/null || which ./rebar3)
|
2016-10-14 17:48:54 +00:00
|
|
|
SUBMODULES = build_utils
|
2016-08-24 11:27:31 +00:00
|
|
|
SUBTARGETS = $(patsubst %,%/.git,$(SUBMODULES))
|
|
|
|
|
2016-09-07 19:43:14 +00:00
|
|
|
UTILS_PATH := build_utils
|
|
|
|
TEMPLATES_PATH := .
|
|
|
|
|
2019-06-25 16:08:15 +00:00
|
|
|
# Name of the service
|
2016-09-07 19:43:14 +00:00
|
|
|
SERVICE_NAME := dominant
|
|
|
|
# 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)
|
|
|
|
|
|
|
|
# Base image for the service
|
2019-06-25 16:08:15 +00:00
|
|
|
BASE_IMAGE_NAME := service-erlang
|
2020-06-22 10:56:37 +00:00
|
|
|
BASE_IMAGE_TAG := 37c294de80c2ff7cd732f9b367914532fd662539
|
2016-09-07 19:43:14 +00:00
|
|
|
|
|
|
|
# Build image tag to be used
|
2020-06-22 10:56:37 +00:00
|
|
|
BUILD_IMAGE_TAG := 07d3946f8f005782697de20270ac58cdcd18b011
|
2016-08-24 11:27:31 +00:00
|
|
|
|
2020-10-13 15:28:11 +00:00
|
|
|
CALL_ANYWHERE := all submodules compile xref lint dialyze start devrel release clean distclean check_format format
|
2016-08-24 11:27:31 +00:00
|
|
|
|
2016-09-07 19:43:14 +00:00
|
|
|
CALL_W_CONTAINER := $(CALL_ANYWHERE) test
|
2016-08-24 11:27:31 +00:00
|
|
|
|
2016-09-07 19:43:14 +00:00
|
|
|
all: compile
|
|
|
|
|
|
|
|
-include $(UTILS_PATH)/make_lib/utils_container.mk
|
|
|
|
-include $(UTILS_PATH)/make_lib/utils_image.mk
|
|
|
|
|
2019-06-25 16:08:15 +00:00
|
|
|
.PHONY: $(CALL_W_CONTAINER)
|
|
|
|
|
2016-08-24 11:27:31 +00:00
|
|
|
# CALL_ANYWHERE
|
|
|
|
$(SUBTARGETS): %/.git: %
|
|
|
|
git submodule update --init $<
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
submodules: $(SUBTARGETS)
|
|
|
|
|
2020-01-27 15:35:33 +00:00
|
|
|
compile: submodules
|
2016-08-24 11:27:31 +00:00
|
|
|
$(REBAR) compile
|
|
|
|
|
|
|
|
xref: submodules
|
|
|
|
$(REBAR) xref
|
|
|
|
|
2017-03-29 15:27:11 +00:00
|
|
|
lint:
|
2016-08-24 11:27:31 +00:00
|
|
|
elvis rock
|
|
|
|
|
2020-10-13 15:28:11 +00:00
|
|
|
check_format:
|
|
|
|
$(REBAR) fmt -c
|
|
|
|
|
|
|
|
format:
|
|
|
|
$(REBAR) fmt -w
|
|
|
|
|
2016-08-24 11:27:31 +00:00
|
|
|
dialyze:
|
|
|
|
$(REBAR) dialyzer
|
|
|
|
|
2017-03-29 15:27:11 +00:00
|
|
|
release: submodules distclean
|
2016-08-24 11:27:31 +00:00
|
|
|
$(REBAR) as prod release
|
|
|
|
|
|
|
|
clean:
|
|
|
|
$(REBAR) clean
|
|
|
|
|
|
|
|
distclean:
|
|
|
|
$(REBAR) clean -a
|
2017-09-12 09:56:22 +00:00
|
|
|
rm -rf _build
|
2016-08-24 11:27:31 +00:00
|
|
|
|
|
|
|
# CALL_W_CONTAINER
|
2016-09-07 19:43:14 +00:00
|
|
|
test: submodules
|
|
|
|
$(REBAR) ct
|