-
Notifications
You must be signed in to change notification settings - Fork 127
/
Copy pathMakefile
106 lines (91 loc) · 3.71 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
MVN=mvn
PROJECT_NAME=spring-startup-analyzer
INSTALL_DIR=${HOME}/${PROJECT_NAME}
.PHONY: clean
clean:
ifeq ($(strip $(VERSION)),)
$(MVN) clean
cd ./spring-profiler-extension && $(MVN) clean
else
$(MVN) clean -Drevision=$(VERSION)
cd ./spring-profiler-extension && $(MVN) clean -Drevision=$(VERSION)
endif
.PHONY: clean-skip-tests
clean-skip-tests:
ifeq ($(strip $(VERSION)),)
$(MVN) clean -Dmaven.test.skip=true
cd ./spring-profiler-extension && $(MVN) clean -Dmaven.test.skip=true
else
$(MVN) clean -Drevision=$(VERSION) -Dmaven.test.skip=true
cd ./spring-profiler-extension && $(MVN) clean -Drevision=$(VERSION) -Dmaven.test.skip=true
endif
.PHONY: package
package: clean install
ifeq ($(strip $(VERSION)),)
${MVN} package -pl '!coverage-report-aggregate,!spring-startup-cli'
cd ./spring-profiler-extension && ${MVN} package
else
${MVN} package -Drevision=$(VERSION) -pl '!coverage-report-aggregate,!spring-startup-cli'
cd ./spring-profiler-extension && ${MVN} package -Drevision=$(VERSION)
endif
mkdir -p ./build && rm -rf ./build/* && cp -r ~/${PROJECT_NAME}/* ./build/ && rm -rf ./build/${PROJECT_NAME}.tar.gz
.PHONY: package-skip-tests
package-skip-tests: clean-skip-tests install-skip-tests
ifeq ($(strip $(VERSION)),)
${MVN} package -pl '!coverage-report-aggregate,!spring-startup-cli' -Dmaven.test.skip=true
cd ./spring-profiler-extension && ${MVN} package -Dmaven.test.skip=true
else
${MVN} package -Drevision=$(VERSION) -pl '!coverage-report-aggregate,!spring-startup-cli' -Dmaven.test.skip=true
cd ./spring-profiler-extension && ${MVN} package -Drevision=$(VERSION) -Dmaven.test.skip=true
endif
mkdir -p ./build && rm -rf ./build/* && cp -r ~/${PROJECT_NAME}/* ./build/ && rm -rf ./build/${PROJECT_NAME}.tar.gz
.PHONY: install
install: clean
ifeq ($(strip $(VERSION)),)
${MVN} install -pl '!coverage-report-aggregate,!spring-startup-cli'
cd ./spring-profiler-extension && ${MVN} install
else
${MVN} install -Drevision=$(VERSION) -pl '!coverage-report-aggregate,!spring-startup-cli'
cd ./spring-profiler-extension && ${MVN} install -Drevision=$(VERSION)
endif
.PHONY: install-skip-tests
install-skip-tests: clean-skip-tests
ifeq ($(strip $(VERSION)),)
${MVN} install -pl '!coverage-report-aggregate,!spring-startup-cli' -Dmaven.test.skip=true
cd ./spring-profiler-extension && ${MVN} install -Dmaven.test.skip=true
else
${MVN} install -Drevision=$(VERSION) -pl '!coverage-report-aggregate,!spring-startup-cli' -Dmaven.test.skip=true
cd ./spring-profiler-extension && ${MVN} install -Drevision=$(VERSION) -Dmaven.test.skip=true
endif
.PHONY: deploy
deploy: clean
ifeq ($(strip $(VERSION)),)
${MVN} deploy -pl '!coverage-report-aggregate,!spring-startup-cli'
cd ./spring-profiler-extension && ${MVN} deploy
else
${MVN} deploy -Drevision=$(VERSION) -pl '!coverage-report-aggregate,!spring-startup-cli'
cd ./spring-profiler-extension && ${MVN} deploy -Drevision=$(VERSION)
endif
.PHONY: deploy-skip-tests
deploy-skip-tests: clean-skip-tests
ifeq ($(strip $(VERSION)),)
${MVN} deploy -pl '!coverage-report-aggregate,!spring-startup-cli' -Dmaven.test.skip=true
cd ./spring-profiler-extension && ${MVN} deploy -Dmaven.test.skip=true
else
${MVN} deploy -Drevision=$(VERSION) -pl '!coverage-report-aggregate,!spring-startup-cli'
cd ./spring-profiler-extension && ${MVN} deploy -Drevision=$(VERSION) -Dmaven.test.skip=true
endif
.PHONY: docker-build
docker-build: package
ifeq ($(strip $(VERSION)),)
docker build --tag ${PROJECT_NAME}:latest .
else
docker build --tag ${PROJECT_NAME}:${VERSION} .
endif
.PHONY: tar
tar:
cd ${INSTALL_DIR} && tar -zcvf ${PROJECT_NAME}.tar.gz ./lib/ ./config/ ./template
.PHONY: all
all: clean install package tar
.PHONY: all-skip-tests
all-skip-tests: clean-skip-tests install-skip-tests package-skip-tests tar