forked from dbpedia/extraction-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
redeploy-server
executable file
·27 lines (22 loc) · 1.13 KB
/
redeploy-server
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
#!/bin/bash
#singleton bash sript: check if it is already running, if so terminate old instance (and its child processes)
# TODO use PID file or sth like this later
set -x
$SHELL --version
PID=`pgrep --oldest ${0##*/} | head -n 1` #get pid of (first started instance of) this script
PGRP=`ps -p $PID -o pgrp | head -n 2 | tail -n 1 | xargs` #get process-group for pid and trim whitespaces with xargs
[[ `pgrep ${0##*/} | wc -l` > 2 ]] && `kill -- -$PGRP` # if more than one instance of this script terminate process group (needed in order to close all forked processes like the extraction framework itself)
#fetch git and preserve local changes hopefully
git stash push
git pull
git stash pop
mvn install -Dskip=true -DskipTests -Dmaven.source.skip=true
#fetch data
cd core
../run download-mappings
../run download-ontology
cd ../server
#TODO create mapping stats, not important for extraction itself
#../run stats #4 required params: input dir, output dir, file suffix ('.gz', '.bz2' or ''), pretty-printing flag (true) may be followed by list of language codes
#../run stats create.mappings.stats.properties # only for template-test
../run server