mirror of https://gitee.com/bigwinds/arangodb
61 lines
1.5 KiB
Bash
Executable File
61 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
export PID=$$
|
|
|
|
if test -n "$ORIGINAL_PATH"; then
|
|
# running in cygwin...
|
|
PS='\'
|
|
export EXT=".exe"
|
|
else
|
|
export EXT=""
|
|
PS='/'
|
|
fi;
|
|
|
|
SCRIPT="utils${PS}generateExamples.js"
|
|
LOGFILE="out${PS}log-$PID"
|
|
DBDIR="out${PS}data-$PID"
|
|
|
|
mkdir -p ${DBDIR}
|
|
|
|
echo Database has its data in ${DBDIR}
|
|
echo Logfile is in ${LOGFILE}
|
|
|
|
if [ -z "${ARANGOD}" ]; then
|
|
if [ -x build/bin/arangod ]; then
|
|
ARANGOD=build/bin/arangod
|
|
elif [ -x bin/arangosh ]; then
|
|
ARANGOD=bin/arangod
|
|
else
|
|
echo "$0: cannot locate arangod"
|
|
fi
|
|
fi
|
|
|
|
${ARANGOD} \
|
|
--configuration none \
|
|
--cluster.agent-path bin${PS}etcd-arango${EXT} \
|
|
--cluster.arangod-path bin${PS}arangod \
|
|
--cluster.coordinator-config etc${PS}relative${PS}arangod-coordinator.conf \
|
|
--cluster.dbserver-config etc${PS}relative${PS}arangod-dbserver.conf \
|
|
--cluster.disable-dispatcher-frontend false \
|
|
--cluster.disable-dispatcher-kickstarter false \
|
|
--cluster.data-path cluster \
|
|
--cluster.log-path cluster \
|
|
--database.directory ${DBDIR} \
|
|
--log.file ${LOGFILE} \
|
|
--server.endpoint tcp://127.0.0.1:$PORT \
|
|
--javascript.startup-directory js \
|
|
--javascript.app-path js${PS}apps \
|
|
--javascript.script $SCRIPT \
|
|
--no-server \
|
|
--temp-path ${PS}var${PS}tmp \
|
|
"${ARGS[@]}" \
|
|
|
|
if test $? -eq 0; then
|
|
echo "removing ${LOGFILE} ${DBDIR}"
|
|
rm -rf ${LOGFILE} ${DBDIR}
|
|
else
|
|
echo "failed - don't remove ${LOGFILE} ${DBDIR} - here's the logfile:"
|
|
cat ${LOGFILE}
|
|
fi
|
|
|
|
echo Server has terminated.
|