@@ -5,10 +5,31 @@ MAKEFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
55PROJECT_DIR := $(patsubst % /,% ,$(dir $(MAKEFILE_PATH ) ) )
66LUACOV_REPORT := $(PROJECT_DIR ) /luacov.report.out
77LUACOV_STATS := $(PROJECT_DIR ) /luacov.stats.out
8+ METRICS ?= $(METRIC_VERSION )
9+ CARTRIDGE ?= $(CARTRIDGE_VERSION )
810
911SHELL := $(shell which bash) # Required for brace expansion used in a clean target.
1012SEED ?= $(shell /bin/bash -c "echo $$RANDOM")
1113
14+ SHELL := /bin/bash
15+
16+ ARCH := $(shell uname -m)
17+ PLATFORM ?= $(shell uname -s | tr [:upper:] [:lower:])
18+ ifeq ($(PLATFORM ) , darwin)
19+ PLATFORM := macos
20+ endif
21+
22+ PWD := $(shell pwd)
23+
24+ TARANTOOL_BUNDLE_PATH ?= enterprise/dev/$(PLATFORM ) /$(ARCH ) /2.11/tarantool-enterprise-sdk-gc64-2.11.5-0-g74b51db7f-r662.$(PLATFORM ) .$(ARCH ) .tar.gz
25+
26+ VERSION_BRANCH := $(shell git branch --show-current)
27+ VERSION := $(shell git describe --tags --long | cut -d'-' -f1-2)
28+ ROCK_FILENAME := expirationd-ee-${VERSION}.all.rock
29+
30+
31+ S3_ENDPOINT_URL ?= https://hb.bizmrg.com
32+
1233all : test
1334
1435# The template (ldoc.tpl) is written using tarantool specific
@@ -25,7 +46,7 @@ luacheck:
2546
2647.PHONY : test
2748test :
28- luatest -v --coverage --shuffle all:${SEED}
49+ .rocks/bin/ luatest -v --coverage --shuffle all:${SEED}
2950
3051$(LUACOV_STATS ) : test
3152
4768 tt rocks make
4869
4970deps-full : deps
50- tt rocks install cartridge 2.7.4
51- tt rocks install metrics 0.13.0
71+ tt rocks install cartridge 2.16.3
72+ ifneq ($(strip $(METRICS ) ) ,)
73+ tt rocks install metrics $(METRICS)
74+ endif
75+
76+ upload-test-logs-for-fstec :
77+ aws --endpoint-url " $( S3_ENDPOINT_URL) " s3 cp expirationd-ee-tests.log " s3://packages/sdk-3-fstec/reports/fstec/expirationd-ee-$( VERSION) -tests.log"
78+
79+ .SILENT : sdk
80+ sdk : # # Download and Install Tarantool SDK
81+ echo Download and Install Tarantool SDK on $(ARCH )
82+ aws --endpoint-url " $( S3_ENDPOINT_URL) " s3 cp " s3://packages/$( TARANTOOL_BUNDLE_PATH) " ./sdk.tar.gz \
83+ && mkdir -p sdk \
84+ && tar -xzvf ./sdk.tar.gz -C sdk --strip 1 \
85+ && rm -f ./sdk.tar.gz \
86+ && chmod 644 sdk/rocks/*
87+
88+ .rocks : sdk # # Install Rocks
89+ source sdk/env.sh \
90+ && tt rocks install vshard 0.1.36 \
91+ && tt rocks install luatest 1.0.1 \
92+ && tt rocks install luacov 0.13.0 \
93+ && tt rocks install luacov-reporters 0.1.0 \
94+ && tt rocks install luacheck 0.26.0
95+ ifneq ($(strip $(METRICS ) ) ,)
96+ source sdk/env.sh && tt rocks install metrics $(METRICS)
97+ endif
98+ ifneq ($(strip $(CARTRIDGE ) ) ,)
99+ source sdk/env.sh && tt rocks install cartridge $(CARTRIDGE)
100+ endif
101+
102+ install-debug-helper :
103+ source sdk/env.sh && tt rocks install https://raw.githubusercontent.com/a1div0/lua-debug-helper/main/lua-debug-helper-1.0.2-1.rockspec
104+
105+ .PHONY : bootstrap
106+ bootstrap : .rocks # # Installs all dependencies
107+
108+ lint :
109+ source sdk/env.sh && .rocks/bin/luacheck .
0 commit comments