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
|
2021-03-11 15:41:15 +00:00
|
|
|
BASE_IMAGE_TAG := c0aee9a464ee26b8887dd9660dca69d4c3444179
|
2016-09-07 19:43:14 +00:00
|
|
|
|
|
|
|
# Build image tag to be used
|
2020-10-23 14:45:41 +00:00
|
|
|
BUILD_IMAGE_NAME := build-erlang
|
2021-03-11 15:41:15 +00:00
|
|
|
BUILD_IMAGE_TAG := 9bedaf514a40f758f1e94d3d542e009bf21d96c1
|
2016-08-24 11:27:31 +00:00
|
|
|
|
2020-12-03 08:34:28 +00:00
|
|
|
CALL_ANYWHERE := all submodules compile xref lint dialyze 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
|