-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
59 lines (46 loc) · 2.06 KB
/
Makefile
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
# global service name
SERVICE := evsrestapi
#######################################################################
# OVERRIDE THIS TO MATCH YOUR PROJECT #
#######################################################################
APP_VERSION := $(shell echo `grep "^version =" build.gradle | sed 's/version = //'`)
VERSION := $(shell echo `grep "^version =" build.gradle | sed 's/version = //; s/.RELEASE//'`)
# Builds should be repeatable, therefore we need a method to reference the git
# sha where a version came from.
GIT_VERSION ?= $(shell echo `git describe --match=NeVeRmAtCh --always --dirty`)
GIT_COMMIT ?= $(shell echo `git log | grep -m1 -oE '[^ ]+$'`)
GIT_COMMITTED_AT ?= $(shell echo `git log -1 --format=%ct`)
GIT_BRANCH ?=
FULL_VERSION := v$(APP_VERSION)-g$(GIT_VERSION)
.PHONY: build
# consider also "docker save..." and "docker load..." to avoid registry.
clean:
./gradlew clean
# Build the library without tests
# On Windows use: git config core.eol lf
build:
./gradlew clean spotlessApply build -x test
test:
./gradlew spotlessCheck -x test
releasetag:
git tag -a "${VERSION}-RC-`/bin/date +%Y-%m-%d`" -m "Release ${VERSION}-RC-`/bin/date +%Y-%m-%d`"
git push origin "${VERSION}-RC-`/bin/date +%Y-%m-%d`"
rmreleasetag:
git tag -d "${VERSION}-RC-`/bin/date +%Y-%m-%d`"
git push origin --delete "${VERSION}-RC-`/bin/date +%Y-%m-%d`"
tag:
git tag -a "v`/bin/date +%Y-%m-%d`-${APP_VERSION}" -m "Release `/bin/date +%Y-%m-%d`"
git push origin "v`/bin/date +%Y-%m-%d`-${APP_VERSION}"
rmtag:
git tag -d "v`/bin/date +%Y-%m-%d`-${APP_VERSION}"
git push origin --delete "v`/bin/date +%Y-%m-%d`-${APP_VERSION}"
version:
@echo $(APP_VERSION)
devreset: build
./src/main/bin/devreset.sh ../data/UnitTestData > log 2>&1 &
scan:
./gradlew dependencies --write-locks
trivy fs gradle.lockfile --format template -o report.html --template "@config/trivy/html.tpl"
grep CRITICAL report.html
/bin/rm -rf gradle/dependency-locks
/bin/rm gradle.lockfile