Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Run a cluster for testing on TravisCI
Also use bash on TravisCI
  • Loading branch information
chrised committed Feb 1, 2018
commit aefcef77d1748f102aea5fb674afe8b5e6041c1c
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ python:
- 3.5
- 3.6
before_install:
- sh scripts/setup_arangodb.sh
- bash scripts/setup_arangodb.sh
install:
- pip install coverage
- pip install pytest
Expand Down
57 changes: 51 additions & 6 deletions scripts/setup_arangodb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,50 @@ ARANGODB_DIR="$DIR/$NAME"
ARANGOD="${ARANGODB_DIR}/bin/arangod_x86_64"

# create database directory
mkdir ${TMP_DIR}
mkdir -p ${TMP_DIR}/agency
mkdir -p ${TMP_DIR}/primary
mkdir -p ${TMP_DIR}/coordinator

echo "Starting ArangoDB Coordinator '${ARANGOD}'"

echo "Starting ArangoDB '${ARANGOD}'"

${ARANGOD} \
--database.directory ${TMP_DIR} \
--database.directory ${TMP_DIR}/agency \
--configuration none \
--server.endpoint tcp://127.0.0.1:8531 \
--javascript.app-path ${ARANGODB_DIR}/js/apps \
--javascript.startup-directory ${ARANGODB_DIR}/js \
--server.jwt-secret=secret_password \
--database.maximal-journal-size 1048576 \
--agency.my-address=tcp://127.0.0.1:8531 \
--agency.endpoint=tcp://127.0.0.1:8531 \
--agency.activate=true \
--agency.size=1 \
--agency.supervision=true &

${ARANGOD} \
--database.directory ${TMP_DIR}/primary \
--configuration none \
--server.endpoint tcp://127.0.0.1:8530 \
--javascript.app-path ${ARANGODB_DIR}/js/apps \
--javascript.startup-directory ${ARANGODB_DIR}/js \
--server.jwt-secret=secret_password \
--database.maximal-journal-size 1048576 \
--cluster.agency-endpoint=tcp://127.0.0.1:8531 \
--cluster.my-role=PRIMARY \
--cluster.my-address=tcp://127.0.0.1:8530 &

${ARANGOD} \
--database.directory ${TMP_DIR}/coordinator \
--configuration none \
--server.endpoint tcp://127.0.0.1:8529 \
--javascript.app-path ${ARANGODB_DIR}/js/apps \
--javascript.startup-directory ${ARANGODB_DIR}/js \
--database.maximal-journal-size 1048576 &
--server.jwt-secret=secret_password \
--database.maximal-journal-size 1048576 \
--cluster.agency-endpoint=tcp://127.0.0.1:8531 \
--cluster.my-role=COORDINATOR \
--cluster.my-address=tcp://127.0.0.1:8529 &

sleep 2

Expand All @@ -45,7 +78,19 @@ if [ "x$process" == "x" ]; then
exit 1
fi

echo "Waiting until ArangoDB is ready on port 8529"
sleep 10
echo "Waiting until ArangoDB Coordinator is ready on port 8529"
timeout=120
n=0
while [[ (-z `curl -k --basic --user "root:" -s "http://127.0.0.1:8529/_api/version" `) && (n -lt timeout) ]] ; do
echo -n "."
sleep 1s
n=$[$n+1]
done

if [[ n -eq timeout ]];
then
echo "Could not start ArangoDB. Timeout reached."
exit 1
fi

echo "ArangoDB is up"