-
Notifications
You must be signed in to change notification settings - Fork 15
/
Makefile
158 lines (126 loc) · 3.98 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
skipTests = false
version=5.0-SNAPSHOT
mvn_exec = mvn -Dmaven.test.skip=${skipTests}
current_dir = $(shell pwd)
search_plugin_version=
ifdef MICA_HOME
mica_home = ${MICA_HOME}
else
mica_home = ${current_dir}/mica_home
endif
mica_log = ${mica_home}/logs
help:
@echo
@echo "Mica Server"
@echo
@echo "Available make targets:"
@echo " all : Clean & install all modules"
@echo " clean : Clean all modules"
@echo " install : Install all modules"
@echo " core : Install core module"
@echo " search : Install search module"
@echo " proto : Install web-model module"
@echo " rest : Install rest module"
@echo
@echo " run : Run webapp module"
@echo " debug : Debug webapp module on port 8002"
@echo " grunt : Start grunt on port 9000"
@echo " npm-install : Download all NodeJS dependencies"
@echo
@echo " clear-log : Delete logs from ${mica_log}"
@echo " drop-mongo : Drop MongoDB mica database"
@echo
@echo " dependencies-tree : Displays the dependency tree"
@echo " dependencies-update : Check for new dependency updates"
@echo " plugins-update : Check for new plugin updates"
@echo
all: clean install
clean:
${mvn_exec} clean
install:
${mvn_exec} install
core:
cd mica-core && ${mvn_exec} clean install
spi:
cd mica-spi && ${mvn_exec} clean install
search:
cd mica-search && ${mvn_exec} clean install
proto: model
model:
cd mica-web-model && ${mvn_exec} clean install
python:
cd ../mica-python-client && ${mvn_exec} install
rest:
cd mica-rest && ${mvn_exec} clean install
log:
tail -f ${mica_home}/logs/mica.log
restlog:
tail -f ${mica_home}/logs/rest.log
seed:
mkdir -p mica-webapp/target/mica_home/seed/in && \
cp mica-core/src/test/resources/seed/studies.json mica-webapp/target/mica_home/seed/in
plugins:
rm -rf ${mica_home}/plugins/* && \
mkdir -p ${mica_home}/plugins && \
cd ../mica-search-es${search_plugin_version} && mvn clean install && \
cp target/mica-search-es${search_plugin_version}-*-dist.zip ${mica_home}/plugins
# cd ${mica_home}/plugins && unzip *zip && rm *zip
run:
cd mica-webapp && \
${mvn_exec} spring-boot:run -Pdev -DMICA_HOME="${mica_home}" -DMICA_LOG="${mica_log}"
run-prod:
cd mica-webapp && \
mvn install -Pci-build && \
cd ../mica-dist && \
mvn clean package && \
cd target && \
unzip mica-${version}-dist.zip && \
mkdir -p ${mica_home} && \
if [ ! -d ${mica_home}/conf ]; then cp -r agate-${version}/conf ${mica_home}/conf; fi
export MICA_HOME="${mica_home}" && \
./mica-${version}/bin/mica2
debug:
cd mica-webapp && \
${mvn_exec} spring-boot:run -Pdev -Dspring-boot.run.jvmArguments="-Xmx2G -agentlib:jdwp=transport=dt_socket,server=y,address=8002,suspend=n -Dspring.profiles.active=dev -DMICA_HOME='${mica_home}' -DMICA_LOG='${mica_log}'"
run-python:
cd ../mica-python-client/target/mica-python/bin && \
chmod +x ./scripts/mica && \
export PYTHONPATH=${current_dir}/../mica-python-client/target/mica-python/bin && \
./scripts/mica ${args}
grunt:
cd mica-webapp && \
grunt server
npm-install:
cd mica-webapp && \
npm install
clear-log:
rm -rf ${mica_log}
drop-mongo:
mongo mica --eval "db.dropDatabase()"
drop-data: drop-mongo
rm -rf ${mica_home}
dependencies-tree:
mvn dependency:tree
dependencies-update:
mvn versions:display-dependency-updates
plugins-update:
mvn versions:display-plugin-updates
elasticsearch-head:
rm -rf .work/elasticsearch-head && \
mkdir -p .work && \
cd .work && \
git clone git://github.com/mobz/elasticsearch-head.git
@echo
@echo "ElasticSearch-Head is available at:"
@echo "file://${current_dir}/.work/elasticsearch-head/index.html"
@echo
vue-mica-search:
cd ../vue-mica-search && \
yarn build-lib && \
cp dist/* ../mica2/mica-webapp/src/main/webapp/assets/libs/node_modules/vue-mica-search/dist/
rql:
cd ../epigeny/rql && \
npm run build && \
cp dist/* ../../mica2/mica-webapp/src/main/webapp/assets/libs/node_modules/rql/dist/
templates:
cd mica-webapp && cp -r src/main/resources/_templates/ target/classes/