|
| 1 | +SHELL := bash |
| 2 | +DEBUG ?= false |
| 3 | +DRY_RUN ?= true |
| 4 | +SKIP_TESTS ?= false |
| 5 | +GITHUB_STEP_SUMMARY ?= |
| 6 | +SCYLLA_VERSION ?= release:2025.3 |
| 7 | +CASSANDRA_VERSION ?= cassanra:5 |
| 8 | + |
| 9 | +#ifeq ($(shell if [[ -n "$${GITHUB_STEP_SUMMARY}" ]]; then echo "running-in-workflow"; else echo "running-in-shell"; fi), running-in-workflow) |
| 10 | +# DEBUG = true |
| 11 | +#endif |
| 12 | + |
| 13 | +ifneq (${GITHUB_STEP_SUMMARY},) |
| 14 | + DEBUG = true |
| 15 | +endif |
| 16 | + |
| 17 | +_RELEASE_PUBLISH ?= |
| 18 | +ifneq (${DRY_RUN},true) |
| 19 | + _RELEASE_PUBLISH= -Drelease.autopublish=true |
| 20 | +endif |
| 21 | + |
| 22 | +_RELEASE_SKIP_TESTS ?= |
| 23 | +ifneq (${SKIP_TESTS},false) |
| 24 | + _RELEASE_SKIP_TESTS= -DskipTests=true -DskipITs=true |
| 25 | +endif |
| 26 | + |
| 27 | +ifeq (${DEBUG},false) |
| 28 | + MVNCMD ?= mvn |
| 29 | +else |
| 30 | + MVNCMD ?= mvn -B -X -ntp |
| 31 | +endif |
| 32 | + |
| 33 | +fmt: |
| 34 | + $(MVNCMD) fmt:format |
| 35 | + |
| 36 | +compile: |
| 37 | + $(MVNCMD) compile test-compile -Dfmt.skip=true -Dclirr.skip=true -Danimal.sniffer.skip=true |
| 38 | + |
| 39 | +verify: |
| 40 | + $(MVNCMD) verify -DskipTests |
| 41 | + |
| 42 | +test-unit: |
| 43 | + $(MVNCMD) test -Dfmt.skip=true -Dclirr.skip=true -Danimal.sniffer.skip=true |
| 44 | + |
| 45 | +test-integration-scylla: |
| 46 | + mvn -Dsurefire.failIfNoSpecifiedTests=false -Dtest=should_stop_if_cancelled_between_attempts -B verify -Pshort -Dscylla.version=$(SCYLLA_VERSION) -Dfmt.skip=true -Dclirr.skip=true -Danimal.sniffer.skip=true |
| 47 | + |
| 48 | +test-integration-cassandra: |
| 49 | + mvn -Dsurefire.failIfNoSpecifiedTests=false -Dtest=should_stop_if_cancelled_between_attempts -B verify -Pshort -Dcassandra.version=$(CASSANDRA_VERSION) -Dfmt.skip=true -Dclirr.skip=true -Danimal.sniffer.skip=true |
| 50 | + |
| 51 | +test: fmt compile verify test-unit |
| 52 | + |
| 53 | +release-prepare: |
| 54 | +ifeq ($(shell if [[ -n "$${GPG_PASSPHRASE}" ]]; then echo "present"; else echo "absent"; fi), absent) |
| 55 | + @echo "environment variable GPG_PASSPHRASE has to be set" |
| 56 | + @exit 1 |
| 57 | +endif |
| 58 | + MAVEN_OPTS="$${MAVEN_OPTS}$(_RELEASE_SKIP_TESTS)" $(MVNCMD) release:prepare -Drelease.push.changes=false -Dgpg.passphrase=$${GPG_PASSPHRASE} |
| 59 | + |
| 60 | +.release: |
| 61 | +ifeq ($(shell if [[ -n "$${GPG_PASSPHRASE}" ]]; then echo "present"; else echo "absent"; fi), absent) |
| 62 | + @echo "environment variable GPG_PASSPHRASE has to be set" |
| 63 | + @exit 1 |
| 64 | +endif |
| 65 | +ifeq ($(shell if [[ -n "$${SONATYPE_TOKEN_USERNAME}" ]]; then echo "present"; else echo "absent"; fi), absent) |
| 66 | + @echo "environment variable SONATYPE_TOKEN_USERNAME has to be set" |
| 67 | + @exit 1 |
| 68 | +endif |
| 69 | +ifeq ($(shell if [[ -n "$${SONATYPE_TOKEN_PASSWORD}" ]]; then echo "present"; else echo "absent"; fi), absent) |
| 70 | + @echo "environment variable SONATYPE_TOKEN_PASSWORD has to be set" |
| 71 | + @exit 1 |
| 72 | +endif |
| 73 | + MAVEN_OPTS="$${MAVEN_OPTS}$(_RELEASE_SKIP_TESTS)" $(MVNCMD) release:perform -Dgpg.passphrase=$${GPG_PASSPHRASE} $(_RELEASE_PUBLISH) |
| 74 | + |
| 75 | +release: |
| 76 | + $(MAKE) .release DRY_RUN=false |
| 77 | + |
| 78 | +release-dry-run: |
| 79 | + $(MAKE) .release DRY_RUN=true |
| 80 | + |
| 81 | + |
0 commit comments