2020-10-14 09:09:26 +00:00
|
|
|
REBAR := $(shell which rebar3 2>/dev/null || which ./rebar3)
|
|
|
|
SUBMODULES = build_utils
|
|
|
|
SUBTARGETS = $(patsubst %,%/.git,$(SUBMODULES))
|
|
|
|
|
|
|
|
UTILS_PATH := build_utils
|
|
|
|
TEMPLATES_PATH := .
|
|
|
|
|
|
|
|
# Name of the service
|
|
|
|
SERVICE_NAME := bouncer
|
|
|
|
# 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
|
|
|
|
BASE_IMAGE_NAME := service-erlang
|
2021-02-18 13:00:56 +00:00
|
|
|
BASE_IMAGE_TAG := 0c1352dbf4a31afe0df372b59699a88f3af7986f
|
2020-10-14 09:09:26 +00:00
|
|
|
|
2021-02-18 08:24:50 +00:00
|
|
|
BUILD_IMAGE_NAME := build-erlang
|
|
|
|
BUILD_IMAGE_TAG := 61a001bbb48128895735a3ac35b0858484fdb2eb
|
2020-10-14 09:09:26 +00:00
|
|
|
CALL_ANYWHERE := \
|
|
|
|
submodules \
|
2021-02-04 14:23:35 +00:00
|
|
|
all compile xref lint format check_format dialyze cover release clean distclean
|
2020-10-14 09:09:26 +00:00
|
|
|
|
|
|
|
CALL_W_CONTAINER := $(CALL_ANYWHERE) test
|
|
|
|
|
|
|
|
.PHONY: $(CALL_W_CONTAINER) all
|
|
|
|
|
|
|
|
all: compile
|
|
|
|
|
|
|
|
-include $(UTILS_PATH)/make_lib/utils_container.mk
|
|
|
|
-include $(UTILS_PATH)/make_lib/utils_image.mk
|
|
|
|
|
|
|
|
$(SUBTARGETS): %/.git: %
|
|
|
|
git submodule update --init $<
|
|
|
|
touch $@
|
|
|
|
|
|
|
|
submodules: $(SUBTARGETS)
|
|
|
|
|
|
|
|
compile: submodules
|
|
|
|
$(REBAR) compile
|
|
|
|
|
|
|
|
xref:
|
|
|
|
$(REBAR) xref
|
|
|
|
|
|
|
|
lint:
|
|
|
|
$(REBAR) lint
|
|
|
|
|
2021-02-04 14:23:35 +00:00
|
|
|
check_format:
|
|
|
|
$(REBAR) fmt -c
|
|
|
|
|
|
|
|
format:
|
|
|
|
$(REBAR) fmt -w
|
|
|
|
|
2020-10-14 09:09:26 +00:00
|
|
|
dialyze:
|
|
|
|
$(REBAR) dialyzer
|
|
|
|
|
|
|
|
release: submodules
|
|
|
|
$(REBAR) as prod release
|
|
|
|
|
|
|
|
clean:
|
|
|
|
$(REBAR) cover -r
|
|
|
|
$(REBAR) clean
|
|
|
|
|
|
|
|
distclean:
|
|
|
|
$(REBAR) clean
|
|
|
|
rm -rf _build
|
|
|
|
|
|
|
|
cover:
|
|
|
|
$(REBAR) cover
|
|
|
|
|
|
|
|
# CALL_W_CONTAINER
|
|
|
|
test: submodules
|
|
|
|
$(REBAR) do eunit, ct
|