mirror of
https://github.com/valitydev/dominant.git
synced 2024-11-06 02:25:17 +00:00
72 lines
1.4 KiB
Makefile
72 lines
1.4 KiB
Makefile
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 := 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
|
|
BASE_IMAGE_NAME := service-erlang
|
|
BASE_IMAGE_TAG := e95691e5793a8cc497d37fd16c8869215846d926
|
|
|
|
# Build image tag to be used
|
|
BUILD_IMAGE_NAME := build-erlang
|
|
BUILD_IMAGE_TAG := 4e43ee45b2d476686130b136dce2572a366d3f6a
|
|
|
|
CALL_ANYWHERE := all submodules compile xref lint dialyze release clean distclean check_format format
|
|
|
|
CALL_W_CONTAINER := $(CALL_ANYWHERE) test
|
|
|
|
all: compile
|
|
|
|
-include $(UTILS_PATH)/make_lib/utils_container.mk
|
|
-include $(UTILS_PATH)/make_lib/utils_image.mk
|
|
|
|
.PHONY: $(CALL_W_CONTAINER)
|
|
|
|
# CALL_ANYWHERE
|
|
$(SUBTARGETS): %/.git: %
|
|
git submodule update --init $<
|
|
touch $@
|
|
|
|
submodules: $(SUBTARGETS)
|
|
|
|
compile: submodules
|
|
$(REBAR) compile
|
|
|
|
xref: submodules
|
|
$(REBAR) xref
|
|
|
|
lint:
|
|
elvis -V rock
|
|
|
|
check_format:
|
|
$(REBAR) fmt -c
|
|
|
|
format:
|
|
$(REBAR) fmt -w
|
|
|
|
dialyze:
|
|
$(REBAR) dialyzer
|
|
|
|
release: submodules distclean
|
|
$(REBAR) as prod release
|
|
|
|
clean:
|
|
$(REBAR) clean
|
|
|
|
distclean:
|
|
$(REBAR) clean -a
|
|
rm -rf _build
|
|
|
|
# CALL_W_CONTAINER
|
|
test: submodules
|
|
$(REBAR) ct
|