forked from rundeck/rundeck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
99 lines (69 loc) · 2.64 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
SHELL=/bin/bash
VNUMBER=$(shell grep version.number= ${PWD}/version.properties | cut -d= -f 2)
ifndef TAG
TAG=$(shell grep version.tag= ${PWD}/version.properties | cut -d= -f 2)
endif
VERSION=${VNUMBER}-${TAG}
ifeq ($(strip $(TAG)),GA)
VERSION=${VNUMBER}
endif
RELEASE=$(shell grep version.release.number= ${PWD}/version.properties | cut -d= -f 2)
PROXY_DEFS=
ifdef http_proxy
# assume that http_proxy is of format http://<host>:<port> or <host>:<port>
gradle_proxy_host=$(shell echo ${http_proxy}|sed 's/http:\/\///'|awk -F ':' '{ print $1 }')
gradle_proxy_port=$(shell echo ${http_proxy}|awk -F ':' '{ print $NF }')
PROXY_DEFS="-Dhttp.proxyHost=$gradle_proxy_host -Dhttp.proxyPort=$gradle_proxy_port"
endif
.PHONY: clean rundeck docs makedocs release core-snapshot test app notes
rundeck: app
@echo $(VERSION)-$(RELEASE)
#app build via gradle
app: rundeck-launcher/launcher/build/libs/rundeck-launcher-$(VERSION).jar
rundeck-launcher/launcher/build/libs/rundeck-launcher-$(VERSION).jar:
./gradlew -g $$(pwd)/gradle-cache $(PROXY_DEFS) -Penvironment=release -PreleaseTag=$(TAG) -PbuildNum=$(RELEASE) assemble
#snapshot and release
core-snapshot:
cd core; ./gradlew $(PROXY_DEFS) -Psnapshot -PbuildNum=$(RELEASE) uploadArchives
release:
cd core; ./gradlew $(PROXY_DEFS) -Penvironment=release -PbuildNum=$(RELEASE) uploadArchives
#test via gradle
test:
@echo Running TestSuite
./gradlew test
#rpm and deb packaging
rpm: docs app
cd packaging; $(MAKE) VERSION=$(VNUMBER) VNAME=$(VERSION) RELEASE=$(RELEASE) rpmclean rpm
deb: docs app
cd packaging; $(MAKE) VERSION=$(VNUMBER) VNAME=$(VERSION) RELEASE=$(RELEASE) debclean deb
#doc build
notes: docs/en/history/toc.conf docs/en/RELEASE.md
docs/en/RELEASE.md: RELEASE.md
cp $< $@
docs/en/history/version-$(VNUMBER).md: RELEASE.md
( echo "% Version $(VNUMBER)" ; \
echo "%" $(shell whoami) ; \
echo "%" $(shell date "+%m/%d/%Y") ; \
echo ; ) >$@
cat RELEASE.md >>$@
docs/en/history/toc.conf: docs/en/history/version-$(VNUMBER).md
echo "1:version-$(VNUMBER).md:Version $(VNUMBER)" > [email protected]
test -f $@ && ( grep -v -q "$(VNUMBER)" $@ && \
cat $@ >> [email protected] && \
mv [email protected] $@ ) || ( mv [email protected] $@ )
makedocs:
$(MAKE) VERSION=$(VERSION) -C docs
docs: makedocs
mkdir -p ./rundeckapp/web-app/docs/jp
cp -r docs/en/dist/html/* ./rundeckapp/web-app/docs
cp -r docs/jp/dist/html/* ./rundeckapp/web-app/docs/jp
#clean various components
clean:
./gradlew clean
$(MAKE) -C docs clean
$(MAKE) -C packaging clean
rm -rf ./gradle-cache
@echo "Cleaning..."
#remove rundeckapp lib dir which may contain previously built jars
-rm rundeckapp/lib/rundeck*.jar
@echo "Cleaned local build artifacts and targets."