damsel/Makefile

143 lines
3.5 KiB
Makefile
Raw Normal View History

THRIFT = $(or $(shell which thrift), $(error "`thrift' executable missing"))
2016-07-21 22:15:27 +00:00
THRIFT_LANGUAGES = erlang java
THRIFT_OPTIONS_erlang = scoped_typenames
THRIFT_OPTIONS_java = fullcamel
THRIFT_OPTIONS_html = standalone
2016-09-09 22:24:38 +00:00
UTILS_PATH := build_utils
TEMPLATES_PATH := .
2016-07-21 22:15:27 +00:00
2016-09-09 22:24:38 +00:00
# Name of the service
SERVICE_NAME := damsel
# 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)
BUILD_IMAGE_TAG := fbef66759ab9c7b620fc73785ba1840d2f48bd68
2016-07-06 15:55:10 +00:00
2016-03-29 11:52:23 +00:00
FILES = $(wildcard proto/*.thrift)
DESTDIR = _gen
RELDIR = _release
CALL_W_CONTAINER := \
all compile doc clean \
java_compile deploy_nexus deploy_epic_nexus java_install \
release-erlang
all: compile
2016-09-09 22:24:38 +00:00
-include $(UTILS_PATH)/make_lib/utils_container.mk
2016-07-11 10:26:45 +00:00
define generate
$(THRIFT) -r -strict --gen $(1):$(THRIFT_OPTIONS_$(1)) -out $(2) $(3)
endef
define targets
$(patsubst %, $(DESTDIR)/$(1)/%, $(FILES))
endef
CUTLINE = $(shell printf '=%.0s' $$(seq 1 80))
.PHONY: all compile doc clean java_compile deploy_nexus deploy_epic_nexus java_install
LANGUAGE_TARGETS = $(foreach lang, $(THRIFT_LANGUAGES), verify-$(lang))
2016-07-06 15:55:10 +00:00
compile: $(LANGUAGE_TARGETS)
@echo "Ok"
verify-%: $(DESTDIR)
@echo "Verifying '$*' ..."
@echo $(CUTLINE)
@$(MAKE) LANGUAGE=$* $(call targets,$*)
@echo
TARGETS = $(call targets,$(LANGUAGE))
$(TARGETS):: $(DESTDIR)/$(LANGUAGE)/%: %
mkdir -p $@
$(call generate,$(LANGUAGE),$@,$<)
clean::
rm -rf $(DESTDIR)
REPODIR = $(abspath $(RELDIR)/$*)
DOCKER_RUN_OPTS := -e BRANCH_NAME
release-%: $(RELDIR)
@echo "Making '$*' release ..."
@echo $(CUTLINE)
@rm -rf $(REPODIR)
$(MAKE) LANGUAGE=$* DESTDIR=$(REPODIR) build-release
clean::
rm -rf $(RELDIR)
$(DESTDIR):
$(RELDIR):
@mkdir -p $@
# Docs
DOCDIR = doc
DOCTARGETS = $(patsubst %.thrift, $(DOCDIR)/%.html, $(FILES))
doc: $(DOCTARGETS)
$(DOCTARGETS): $(DOCDIR)/%.html: %.thrift
mkdir -p $(dir $@)
$(call generate,html,$(dir $@),$<)
# Erlang
ERLC ?= erlc
ifeq ($(LANGUAGE), erlang)
ifneq ($(shell which $(ERLC)),)
$(TARGETS):: $(DESTDIR)/$(LANGUAGE)/%: %
$(ERLC) -v -I$@ -o$@ $(shell find $@ -name "*.erl")
build-release:
@make THRIFT="$(THRIFT)" FILES="$(abspath $(FILES))" -C build/erlang release
endif
endif
# Java
2016-09-09 22:24:38 +00:00
ifdef SETTINGS_XML
DOCKER_RUN_OPTS = -v $(SETTINGS_XML):$(SETTINGS_XML)
DOCKER_RUN_OPTS += -e SETTINGS_XML=$(SETTINGS_XML)
endif
ifdef LOCAL_BUILD
DOCKER_RUN_OPTS += -v $$HOME/.m2:/home/$(UNAME)/.m2:rw
endif
2016-07-06 15:55:10 +00:00
COMMIT_HASH = $(shell git --no-pager log -1 --pretty=format:"%h")
2016-08-22 12:13:50 +00:00
NUMBER_COMMITS = $(shell git rev-list --count HEAD)
2016-07-11 10:26:45 +00:00
java_compile:
2016-09-09 22:24:38 +00:00
$(if $(SETTINGS_XML),,echo "SETTINGS_XML not defined" ; exit 1)
mvn compile -s $(SETTINGS_XML)
2016-07-11 10:26:45 +00:00
2016-07-06 15:55:10 +00:00
deploy_nexus:
2016-09-09 22:24:38 +00:00
$(if $(SETTINGS_XML),, echo "SETTINGS_XML not defined"; exit 1)
mvn versions:set versions:commit -DnewVersion="1.$(NUMBER_COMMITS)-$(COMMIT_HASH)" -s $(SETTINGS_XML) \
&& mvn deploy -s $(SETTINGS_XML) -Dpath_to_thrift="$(THRIFT)" -Dcommit.number="$(NUMBER_COMMITS)"
HG-192: Introduce multiclaims (#131) * DC-23: changed PartyManagement interface to claims (#122) * DC-23: changed PartyManagement interface to work with claims as primary editing method DC-25: changed PartyChangeset to match with new interface (DC-23) Moved ShopLocation to Shop level * added ContractExpiered status and creation timestamp * changed contracts & shops IDs types from Int to String * extracted ShopUpdate fields to ShopModification level * added InvalidChangeset exception * Claim effects added (v0.1) * Claim effects v1.0 * Claim effects v1.1 added created_at in all party objects * Added ShopProxyChanged effect produced by ProxyModification changeset * added ClaimUpdated event and ClaimRevision property * added revision check to AcceptClaim * added revision to deny/revoke methods for uniformity * added ShopContractChanged to make one-to-one relations beetween change & effect * Category is back to ShopParams as optional field * AcceptClaim can throw InvalidChangeset exception * Added AnonymousEntity to fulfill contract creation requirements * Renamed AninymousEntity to RegisteredUser * Added PayoutToolType to distinguish test and live payout tools * Removed payout tool type due to redundancy * Added PayoutToolPrototype to incapsulate test payout tool params * Walker2 API (#125) * Walker 2 api new Methods for CRUD operations fro Claims, Comments and history(Actions) WALK-20 * rename to wc_deploy * add deploy_epic_nexus to list * fix make cmd * fixed suspension naming * elastico interface get end search party methods Ft/walk 27/elastico (#133) * Syncronize walker and payment processing thrifts * WALK-27: Bump to rbkmoney/image-build@efd28e5 (#138) * DC-27: added timestamp and revision to claim related events * DC-27: added updated timestamp to claim Added timestamp to blocking/suspension statuses (party & shop) for same reason. * DC-27: removed unnecessary timestamp from accepted status (#143) * Added missed InvalidContractStatus exception (#144) * Removed timestamp from ContractTermination changeset rebased to newest master * jenkins pr crutch * update walker 2 interface * fix signature * replace strings * add update and create date * Event batching v0.1 (obvious one) (#160) * HG-227: Publish formerly internal events (#161) * HG-227: Streamline event payload definitions * HG-227: Publish formerly internal events * HG-227: Introduce session-level result * HG-227: Start classifying operation failures * HG-227: Differentiate between domain and payproc invoicing models * HG-227: Strip domain models further * HG-227: Make risk score, route and cash flow required * HG-227: Give shop location back to proxies (#164)
2017-07-17 10:21:41 +00:00
deploy_epic_nexus:
$(if $(SETTINGS_XML),, echo "SETTINGS_XML not defined"; exit 1)
mvn versions:set versions:commit -DnewVersion="1.$(NUMBER_COMMITS)-$(COMMIT_HASH)-epic" -s $(SETTINGS_XML) \
&& mvn deploy -s $(SETTINGS_XML) -Dpath_to_thrift="$(THRIFT)" -Dcommit.number="$(NUMBER_COMMITS)"
HG-192: Introduce multiclaims (#131) * DC-23: changed PartyManagement interface to claims (#122) * DC-23: changed PartyManagement interface to work with claims as primary editing method DC-25: changed PartyChangeset to match with new interface (DC-23) Moved ShopLocation to Shop level * added ContractExpiered status and creation timestamp * changed contracts & shops IDs types from Int to String * extracted ShopUpdate fields to ShopModification level * added InvalidChangeset exception * Claim effects added (v0.1) * Claim effects v1.0 * Claim effects v1.1 added created_at in all party objects * Added ShopProxyChanged effect produced by ProxyModification changeset * added ClaimUpdated event and ClaimRevision property * added revision check to AcceptClaim * added revision to deny/revoke methods for uniformity * added ShopContractChanged to make one-to-one relations beetween change & effect * Category is back to ShopParams as optional field * AcceptClaim can throw InvalidChangeset exception * Added AnonymousEntity to fulfill contract creation requirements * Renamed AninymousEntity to RegisteredUser * Added PayoutToolType to distinguish test and live payout tools * Removed payout tool type due to redundancy * Added PayoutToolPrototype to incapsulate test payout tool params * Walker2 API (#125) * Walker 2 api new Methods for CRUD operations fro Claims, Comments and history(Actions) WALK-20 * rename to wc_deploy * add deploy_epic_nexus to list * fix make cmd * fixed suspension naming * elastico interface get end search party methods Ft/walk 27/elastico (#133) * Syncronize walker and payment processing thrifts * WALK-27: Bump to rbkmoney/image-build@efd28e5 (#138) * DC-27: added timestamp and revision to claim related events * DC-27: added updated timestamp to claim Added timestamp to blocking/suspension statuses (party & shop) for same reason. * DC-27: removed unnecessary timestamp from accepted status (#143) * Added missed InvalidContractStatus exception (#144) * Removed timestamp from ContractTermination changeset rebased to newest master * jenkins pr crutch * update walker 2 interface * fix signature * replace strings * add update and create date * Event batching v0.1 (obvious one) (#160) * HG-227: Publish formerly internal events (#161) * HG-227: Streamline event payload definitions * HG-227: Publish formerly internal events * HG-227: Introduce session-level result * HG-227: Start classifying operation failures * HG-227: Differentiate between domain and payproc invoicing models * HG-227: Strip domain models further * HG-227: Make risk score, route and cash flow required * HG-227: Give shop location back to proxies (#164)
2017-07-17 10:21:41 +00:00
java_install:
$(if $(SETTINGS_XML),, echo "SETTINGS_XML not defined"; exit 1)
mvn clean -s $(SETTINGS_XML) && \
mvn versions:set versions:commit -DnewVersion="1.$(NUMBER_COMMITS)-$(COMMIT_HASH)" -s $(SETTINGS_XML) \
&& mvn install -s $(SETTINGS_XML) -Dpath_to_thrift="$(THRIFT)" -Dcommit.number="$(NUMBER_COMMITS)"