forked from rundeck/rundeck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
88 lines (63 loc) · 2.73 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
SHELL=/bin/bash
VERSION=$(shell grep version.number= ${PWD}/version.properties | cut -d= -f 2)
RELEASE=$(shell grep version.release.number= ${PWD}/version.properties | cut -d= -f 2)
GRAILSVERS=1.3.7
JETTYVERS=6.1.21
GRAILS_HOME=${PWD}/build/local/grails-${GRAILSVERS}
#PATH=$PATH:$GRAILS_HOME/bin
GARGS += -Dgrails.project.work.dir=${PWD}/rundeckapp/work
GRAILS=$(GRAILS_HOME)/bin/grails $(GARGS)
RUNDECK_FILES=$(shell find rundeckapp/{src,test,grails-app,scripts} -name "*.java" -o -name "*.groovy" -o -name "*.gsp")
CORE_FILES=$(shell find core/src -name "*.java" -o -name "*.templates" -o -path "*/src/sh/*")
PLUGIN_FILES=$(shell find plugins/*-plugin -name "*.java" )
plugs= $(shell for i in plugins/*-plugin ; do v=` basename $$i`; echo $$i/build/libs/rundeck-$${v}-$(VERSION).jar ; done )
core = core/build/libs/rundeck-core-$(VERSION).jar
war = rundeckapp/target/rundeck-$(VERSION).war
launcher = rundeckapp/target/rundeck-launcher-$(VERSION).jar
.PHONY: clean rundeck docs makedocs plugins
rundeck: $(launcher)
@echo $(VERSION)-$(RELEASE)
rpm: docs $(war) $(plugs)
cd packaging; $(MAKE) VERSION=$(VERSION) RELEASE=$(RELEASE) rpmclean rpm
deb: docs $(war) $(plugs)
cd packaging; $(MAKE) VERSION=$(VERSION) RELEASE=$(RELEASE) debclean deb
makedocs:
$(MAKE) -C docs
$(core): $(CORE_FILES)
./build.sh rundeck_core
$(war): $(launcher)
$(plugs): $(core) $(PLUGIN_FILES)
cd plugins && ./gradlew
plugins: $(plugs)
-rm -rf ./rundeckapp/target/launcher-contents/libext
mkdir -p ./rundeckapp/target/launcher-contents/libext
for i in $(plugs) ; do cp $$i ./rundeckapp/target/launcher-contents/libext/ ; done
docs: makedocs
-rm -rf ./rundeckapp/target/launcher-contents/docs ./rundeckapp/web-app/docs
mkdir -p ./rundeckapp/target/launcher-contents/docs/man/man1
mkdir -p ./rundeckapp/target/launcher-contents/docs/man/man5
mkdir -p ./rundeckapp/web-app/docs
cp -r docs/en/dist/html/* ./rundeckapp/target/launcher-contents/docs
cp -r docs/en/dist/html/* ./rundeckapp/web-app/docs
cp docs/en/dist/man/man1/*.1 ./rundeckapp/target/launcher-contents/docs/man/man1
cp docs/en/dist/man/man5/*.5 ./rundeckapp/target/launcher-contents/docs/man/man5
$(launcher): $(core) plugins $(RUNDECK_FILES)
./build.sh rundeckapp
.PHONY: test
test: $(war)
@echo Running TestSuite
pushd rundeckapp; $(GRAILS) test-app; popd
clean:
-rm $(core) $(war) $(launcher) $(plugs)
$(MAKE) -C docs clean
pushd rundeckapp; $(GRAILS) clean; popd
@echo "Cleaning..."
#clean localrepo of build artifacts
-rm -r build/localrepo/rundeck*
#remove rundeckapp lib dir which may contain previously built jars
-rm rundeckapp/lib/rundeck*.jar
#clean build target dirs
-rm -rf core/target
-rm -rf core/build
-rm -r rundeckapp/target
@echo "Cleaned local build artifacts and targets."