forked from datastax/simulacron
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
81 lines (63 loc) · 2.09 KB
/
Makefile
File metadata and controls
81 lines (63 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
SHELL := bash
DEBUG ?= false
DRY_RUN ?= true
SKIP_TESTS ?= false
GITHUB_STEP_SUMMARY ?=
RELEASE_VERSION ?=
#ifeq ($(shell if [[ -n "$${GITHUB_STEP_SUMMARY}" ]]; then echo "running-in-workflow"; else echo "running-in-shell"; fi), running-in-workflow)
# DEBUG = true
#endif
ifneq (${GITHUB_STEP_SUMMARY},)
DEBUG = true
endif
_RELEASE_PUBLISH ?=
ifneq (${DRY_RUN},true)
_RELEASE_PUBLISH= -Drelease.autopublish=true
endif
_RELEASE_SKIP_TESTS ?=
ifneq (${SKIP_TESTS},false)
_RELEASE_SKIP_TESTS= -DskipTests=true -DskipITs=true
endif
_RELEASE_VERSION_FLAG ?=
ifneq (${RELEASE_VERSION},)
_RELEASE_VERSION_FLAG= -DreleaseVersion=${RELEASE_VERSION}
endif
ifeq (${DEBUG},false)
MVNCMD ?= mvn
else
MVNCMD ?= mvn -B -X -ntp
endif
fmt:
$(MVNCMD) fmt:format
compile:
$(MVNCMD) compile test-compile -Dfmt.skip=true -Dclirr.skip=true -Danimal.sniffer.skip=true
verify:
$(MVNCMD) verify -DskipTests
test-unit:
$(MVNCMD) test -Dfmt.skip=true -Dclirr.skip=true -Danimal.sniffer.skip=true
test: fmt compile verify test-unit
release-prepare:
ifeq ($(shell if [[ -n "$${MAVEN_GPG_PASSPHRASE}" ]]; then echo "present"; else echo "absent"; fi), absent)
@echo "environment variable MAVEN_GPG_PASSPHRASE has to be set"
@exit 1
endif
MAVEN_OPTS="$${MAVEN_OPTS}$(_RELEASE_SKIP_TESTS)" $(MVNCMD) release:prepare -Drelease.push.changes=false \
$(_RELEASE_VERSION_FLAG)
.release:
ifeq ($(shell if [[ -n "$${MAVEN_GPG_PASSPHRASE}" ]]; then echo "present"; else echo "absent"; fi), absent)
@echo "environment variable MAVEN_GPG_PASSPHRASE has to be set"
@exit 1
endif
ifeq ($(shell if [[ -n "$${SONATYPE_TOKEN_USERNAME}" ]]; then echo "present"; else echo "absent"; fi), absent)
@echo "environment variable SONATYPE_TOKEN_USERNAME has to be set"
@exit 1
endif
ifeq ($(shell if [[ -n "$${SONATYPE_TOKEN_PASSWORD}" ]]; then echo "present"; else echo "absent"; fi), absent)
@echo "environment variable SONATYPE_TOKEN_PASSWORD has to be set"
@exit 1
endif
MAVEN_OPTS="$${MAVEN_OPTS}$(_RELEASE_SKIP_TESTS)" $(MVNCMD) release:perform $(_RELEASE_PUBLISH)
release:
$(MAKE) .release DRY_RUN=false
release-dry-run:
$(MAKE) .release DRY_RUN=true