forked from Ostico/pyorient
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Niko Usai
committed
Sep 1, 2015
1 parent
8c186d7
commit e663383
Showing
5 changed files
with
344 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,3 +39,4 @@ wiki | |
.idea | ||
/ci/environment | ||
*.zip | ||
cover |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- ~ Copyright (c) 2008-2012, Hazel Bilisim Ltd. All Rights Reserved. ~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); ~ you may | ||
not use this file except in compliance with the License. ~ You may obtain | ||
a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0 ~ | ||
~ Unless required by applicable law or agreed to in writing, software ~ distributed | ||
under the License is distributed on an "AS IS" BASIS, ~ WITHOUT WARRANTIES | ||
OR CONDITIONS OF ANY KIND, either express or implied. ~ See the License for | ||
the specific language governing permissions and ~ limitations under the License. --> | ||
|
||
<hazelcast | ||
xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.0.xsd" | ||
xmlns="http://www.hazelcast.com/schema/config" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<group> | ||
<name>orientdb</name> | ||
<password>orientdb</password> | ||
</group> | ||
<network> | ||
<port auto-increment="true">2434</port> | ||
<join> | ||
<multicast enabled="false"> | ||
<multicast-group>235.1.1.1</multicast-group> | ||
<multicast-port>2434</multicast-port> | ||
</multicast> | ||
<tcp-ip enabled="true"> | ||
<member>localhost:2434</member> | ||
<member>localhost:2435</member> | ||
</tcp-ip> | ||
</join> | ||
</network> | ||
<executor-service> | ||
<pool-size>16</pool-size> | ||
</executor-service> | ||
</hazelcast> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<orient-server> | ||
<handlers> | ||
<handler class="com.orientechnologies.orient.graph.handler.OGraphServerHandler"> | ||
<parameters> | ||
<parameter value="true" name="enabled"/> | ||
<parameter value="50" name="graph.pool.max"/> | ||
</parameters> | ||
</handler> | ||
<handler class="com.orientechnologies.orient.server.hazelcast.OHazelcastPlugin"> | ||
<parameters> | ||
<parameter value="true" name="enabled"/> | ||
<parameter value="${ORIENTDB_HOME}/config/default-distributed-db-config.json" name="configuration.db.default"/> | ||
<parameter value="${ORIENTDB_HOME}/config/orientdb-distr-hazelcast.xml" name="configuration.hazelcast"/> | ||
<parameter value="node-one" name="nodeName"/> | ||
<parameter value="com.orientechnologies.orient.server.distributed.conflict.ODefaultReplicationConflictResolver" name="conflict.resolver.impl"/> | ||
</parameters> | ||
</handler> | ||
<handler class="com.orientechnologies.orient.server.handler.OJMXPlugin"> | ||
<parameters> | ||
<parameter value="false" name="enabled"/> | ||
<parameter value="true" name="profilerManaged"/> | ||
</parameters> | ||
</handler> | ||
<handler class="com.orientechnologies.orient.server.handler.OAutomaticBackup"> | ||
<parameters> | ||
<parameter value="false" name="enabled"/> | ||
<parameter value="4h" name="delay"/> | ||
<parameter value="backup" name="target.directory"/> | ||
<parameter value="${DBNAME}-${DATE:yyyyMMddHHmmss}.zip" name="target.fileName"/> | ||
<parameter value="9" name="compressionLevel"/> | ||
<parameter value="1048576" name="bufferSize"/> | ||
<parameter value="" name="db.include"/> | ||
<parameter value="" name="db.exclude"/> | ||
</parameters> | ||
</handler> | ||
<handler class="com.orientechnologies.orient.server.handler.OServerSideScriptInterpreter"> | ||
<parameters> | ||
<parameter value="true" name="enabled"/> | ||
<parameter value="SQL" name="allowedLanguages"/> | ||
</parameters> | ||
</handler> | ||
<handler class="com.orientechnologies.orient.server.token.OrientTokenHandler"> | ||
<parameters> | ||
<parameter value="true" name="enabled"/> | ||
<parameter value="a_little_pass" name="oAuth2Key"/> | ||
<parameter value="60" name="sessionLength"/> | ||
<parameter value="HmacSHA256" name="encryptionAlgorithm"/> | ||
</parameters> | ||
</handler> | ||
</handlers> | ||
<network> | ||
<sockets> | ||
<socket implementation="com.orientechnologies.orient.server.network.OServerSSLSocketFactory" name="ssl"> | ||
<parameters> | ||
<parameter value="false" name="network.ssl.clientAuth"/> | ||
<parameter value="config/cert/orientdb.ks" name="network.ssl.keyStore"/> | ||
<parameter value="password" name="network.ssl.keyStorePassword"/> | ||
<parameter value="config/cert/orientdb.ks" name="network.ssl.trustStore"/> | ||
<parameter value="password" name="network.ssl.trustStorePassword"/> | ||
</parameters> | ||
</socket> | ||
<socket implementation="com.orientechnologies.orient.server.network.OServerSSLSocketFactory" name="https"> | ||
<parameters> | ||
<parameter value="false" name="network.ssl.clientAuth"/> | ||
<parameter value="config/cert/orientdb.ks" name="network.ssl.keyStore"/> | ||
<parameter value="password" name="network.ssl.keyStorePassword"/> | ||
<parameter value="config/cert/orientdb.ks" name="network.ssl.trustStore"/> | ||
<parameter value="password" name="network.ssl.trustStorePassword"/> | ||
</parameters> | ||
</socket> | ||
</sockets> | ||
<protocols> | ||
<protocol implementation="com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary" name="binary"/> | ||
<protocol implementation="com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpDb" name="http"/> | ||
</protocols> | ||
<listeners> | ||
<listener protocol="binary" socket="default" port-range="2424" ip-address="0.0.0.0"> | ||
<parameters> | ||
<parameter value="true" name="network.binary.debug"/> | ||
</parameters> | ||
</listener> | ||
<listener protocol="http" socket="default" port-range="2480-2490" ip-address="0.0.0.0"> | ||
<commands> | ||
<command implementation="com.orientechnologies.orient.server.network.protocol.http.command.get.OServerCommandGetStaticContent" pattern="GET|www GET|studio/ GET| GET|*.htm GET|*.html GET|*.xml GET|*.jpeg GET|*.jpg GET|*.png GET|*.gif GET|*.js GET|*.css GET|*.swf GET|*.ico GET|*.txt GET|*.otf GET|*.pjs GET|*.svg GET|*.json GET|*.woff GET|*.ttf GET|*.svgz" stateful="false"> | ||
<parameters> | ||
<entry value="Cache-Control: no-cache, no-store, max-age=0, must-revalidate\r\nPragma: no-cache" name="http.cache:*.htm *.html"/> | ||
<entry value="Cache-Control: max-age=120" name="http.cache:default"/> | ||
</parameters> | ||
</command> | ||
<command implementation="com.orientechnologies.orient.graph.server.command.OServerCommandGetGephi" pattern="GET|gephi/*" stateful="false"/> | ||
</commands> | ||
<parameters> | ||
<parameter value="utf-8" name="network.http.charset"/> | ||
</parameters> | ||
</listener> | ||
</listeners> | ||
</network> | ||
<storages/> | ||
<users> | ||
<user resources="*" password="root" name="root"/> | ||
<user resources="connect,server.listDatabases,server.dblist" password="guest" name="guest"/> | ||
<user resources="database.passthrough" password="37AE556A1E32034047178A29FADA9AFB05064DB83489CC63FC71E68066D386D2" name="replicator"/> | ||
</users> | ||
<properties> | ||
<entry value="1" name="db.pool.min"/> | ||
<entry value="50" name="db.pool.max"/> | ||
<entry value="true" name="profiler.enabled"/> | ||
<entry value="finest" name="log.console.level"/> | ||
<entry value="finest" name="log.file.level"/> | ||
</properties> | ||
</orient-server> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<orient-server> | ||
<handlers> | ||
<handler class="com.orientechnologies.orient.graph.handler.OGraphServerHandler"> | ||
<parameters> | ||
<parameter value="true" name="enabled"/> | ||
<parameter value="50" name="graph.pool.max"/> | ||
</parameters> | ||
</handler> | ||
<handler class="com.orientechnologies.orient.server.hazelcast.OHazelcastPlugin"> | ||
<parameters> | ||
<parameter value="true" name="enabled"/> | ||
<parameter value="${ORIENTDB_HOME}/config/default-distributed-db-config.json" name="configuration.db.default"/> | ||
<parameter value="${ORIENTDB_HOME}/config/orientdb-distr-hazelcast.xml" name="configuration.hazelcast"/> | ||
<parameter value="node-two" name="nodeName"/> | ||
<parameter value="com.orientechnologies.orient.server.distributed.conflict.ODefaultReplicationConflictResolver" name="conflict.resolver.impl"/> | ||
</parameters> | ||
</handler> | ||
<handler class="com.orientechnologies.orient.server.handler.OJMXPlugin"> | ||
<parameters> | ||
<parameter value="false" name="enabled"/> | ||
<parameter value="true" name="profilerManaged"/> | ||
</parameters> | ||
</handler> | ||
<handler class="com.orientechnologies.orient.server.handler.OAutomaticBackup"> | ||
<parameters> | ||
<parameter value="false" name="enabled"/> | ||
<parameter value="4h" name="delay"/> | ||
<parameter value="backup" name="target.directory"/> | ||
<parameter value="${DBNAME}-${DATE:yyyyMMddHHmmss}.zip" name="target.fileName"/> | ||
<parameter value="9" name="compressionLevel"/> | ||
<parameter value="1048576" name="bufferSize"/> | ||
<parameter value="" name="db.include"/> | ||
<parameter value="" name="db.exclude"/> | ||
</parameters> | ||
</handler> | ||
<handler class="com.orientechnologies.orient.server.handler.OServerSideScriptInterpreter"> | ||
<parameters> | ||
<parameter value="true" name="enabled"/> | ||
<parameter value="SQL" name="allowedLanguages"/> | ||
</parameters> | ||
</handler> | ||
<handler class="com.orientechnologies.orient.server.token.OrientTokenHandler"> | ||
<parameters> | ||
<parameter value="true" name="enabled"/> | ||
<parameter value="a_little_pass" name="oAuth2Key"/> | ||
<parameter value="60" name="sessionLength"/> | ||
<parameter value="HmacSHA256" name="encryptionAlgorithm"/> | ||
</parameters> | ||
</handler> | ||
</handlers> | ||
<network> | ||
<sockets> | ||
<socket implementation="com.orientechnologies.orient.server.network.OServerSSLSocketFactory" name="ssl"> | ||
<parameters> | ||
<parameter value="false" name="network.ssl.clientAuth"/> | ||
<parameter value="config/cert/orientdb.ks" name="network.ssl.keyStore"/> | ||
<parameter value="password" name="network.ssl.keyStorePassword"/> | ||
<parameter value="config/cert/orientdb.ks" name="network.ssl.trustStore"/> | ||
<parameter value="password" name="network.ssl.trustStorePassword"/> | ||
</parameters> | ||
</socket> | ||
<socket implementation="com.orientechnologies.orient.server.network.OServerSSLSocketFactory" name="https"> | ||
<parameters> | ||
<parameter value="false" name="network.ssl.clientAuth"/> | ||
<parameter value="config/cert/orientdb.ks" name="network.ssl.keyStore"/> | ||
<parameter value="password" name="network.ssl.keyStorePassword"/> | ||
<parameter value="config/cert/orientdb.ks" name="network.ssl.trustStore"/> | ||
<parameter value="password" name="network.ssl.trustStorePassword"/> | ||
</parameters> | ||
</socket> | ||
</sockets> | ||
<protocols> | ||
<protocol implementation="com.orientechnologies.orient.server.network.protocol.binary.ONetworkProtocolBinary" name="binary"/> | ||
<protocol implementation="com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpDb" name="http"/> | ||
</protocols> | ||
<listeners> | ||
<listener protocol="binary" socket="default" port-range="2425" ip-address="0.0.0.0"> | ||
<parameters> | ||
<parameter value="true" name="network.binary.debug"/> | ||
</parameters> | ||
</listener> | ||
<listener protocol="http" socket="default" port-range="2480-2490" ip-address="0.0.0.0"> | ||
<commands> | ||
<command implementation="com.orientechnologies.orient.server.network.protocol.http.command.get.OServerCommandGetStaticContent" pattern="GET|www GET|studio/ GET| GET|*.htm GET|*.html GET|*.xml GET|*.jpeg GET|*.jpg GET|*.png GET|*.gif GET|*.js GET|*.css GET|*.swf GET|*.ico GET|*.txt GET|*.otf GET|*.pjs GET|*.svg GET|*.json GET|*.woff GET|*.ttf GET|*.svgz" stateful="false"> | ||
<parameters> | ||
<entry value="Cache-Control: no-cache, no-store, max-age=0, must-revalidate\r\nPragma: no-cache" name="http.cache:*.htm *.html"/> | ||
<entry value="Cache-Control: max-age=120" name="http.cache:default"/> | ||
</parameters> | ||
</command> | ||
<command implementation="com.orientechnologies.orient.graph.server.command.OServerCommandGetGephi" pattern="GET|gephi/*" stateful="false"/> | ||
</commands> | ||
<parameters> | ||
<parameter value="utf-8" name="network.http.charset"/> | ||
</parameters> | ||
</listener> | ||
</listeners> | ||
</network> | ||
<storages/> | ||
<users> | ||
<user resources="*" password="root" name="root"/> | ||
<user resources="connect,server.listDatabases,server.dblist" password="guest" name="guest"/> | ||
<user resources="database.passthrough" password="B36DA3ABFCD72024EEBDA99F945E2CEAAC9DCC9835FC437A6B77F4868D5CEF46" name="replicator"/> | ||
</users> | ||
<properties> | ||
<entry value="1" name="db.pool.min"/> | ||
<entry value="50" name="db.pool.max"/> | ||
<entry value="true" name="profiler.enabled"/> | ||
<entry value="finest" name="log.console.level"/> | ||
<entry value="finest" name="log.file.level"/> | ||
</properties> | ||
</orient-server> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
PARENT_DIR=$(dirname $(cd "$(dirname "$0")"; pwd)) | ||
CI_DIR="$PARENT_DIR/ci/environment" | ||
DEFAULT_ORIENT_VERSION="2.1.0" | ||
|
||
# launch simple instance in debug mode with shell hang up | ||
while [ $# -ne 0 ]; do | ||
case $1 in | ||
-h) #set option "a" | ||
HANG_UP=true | ||
shift | ||
;; | ||
*) ODB_VERSION=${1:-"${DEFAULT_ORIENT_VERSION}"} ; shift ;; | ||
\?) #unrecognized option - show help | ||
echo "Usage: ./start-ci.sh [-h] [orient-version]" \\n | ||
exit 2 | ||
;; | ||
esac | ||
done | ||
|
||
if [[ -z "${ODB_VERSION}" ]]; then | ||
ODB_VERSION=${DEFAULT_ORIENT_VERSION} | ||
fi | ||
|
||
# ---- Start | ||
|
||
ODB_DIR="${CI_DIR}/orientdb-community-${ODB_VERSION}" | ||
ODB_LAUNCHER="${ODB_DIR}/bin/server.sh" | ||
|
||
echo "=== Initializing CI environment ===" | ||
|
||
cd "$PARENT_DIR" | ||
|
||
. "$PARENT_DIR/ci/_bash_utils.sh" | ||
|
||
if [ ! -d "$ODB_DIR/bin" ]; then | ||
|
||
# Download and extract OrientDB server | ||
echo "--- Downloading OrientDB v${ODB_VERSION} ---" | ||
build ${ODB_VERSION} ${CI_DIR} | ||
|
||
# Ensure that launcher script is executable and copy configurations file | ||
echo "--- Setting up OrientDB ---" | ||
chmod +x ${ODB_LAUNCHER} | ||
chmod -R +rw "${ODB_DIR}/config/" | ||
|
||
if [[ "${ODB_VERSION}" == "1.7.10" ]]; then | ||
cp ${PARENT_DIR}/ci/orientdb-server-config_1.7.10.xml "${ODB_DIR}/config/orientdb-server-config.xml" | ||
elif [[ "${ODB_VERSION}" == *"2.1"* ]]; then | ||
cp ${PARENT_DIR}/ci/orientdb-server-config_2.0.xml "${ODB_DIR}/config/orientdb-server-config.xml" | ||
elif [[ "${ODB_VERSION}" != *"2.0"* ]]; then | ||
cp ${PARENT_DIR}/ci/orientdb-server-config.xml "${ODB_DIR}/config/orientdb-server-config.xml" | ||
else | ||
cp ${PARENT_DIR}/ci/orientdb-server-config_2.0.xml "${ODB_DIR}/config/orientdb-server-config.xml" | ||
fi | ||
|
||
cp ${PARENT_DIR}/ci/orientdb-server-log.properties "${ODB_DIR}/config/" | ||
|
||
if [ ! -d "${ODB_DIR}/databases" ]; then | ||
mkdir ${ODB_DIR}/databases | ||
fi | ||
|
||
else | ||
echo "!!! Found OrientDB v${ODB_VERSION} in ${ODB_DIR} !!!" | ||
fi | ||
|
||
echo "Installing databases: " | ||
echo "cp -a ${PARENT_DIR}/tests/default_databases/GratefulDeadConcerts \"${ODB_DIR}/databases/\"" | ||
cp -a ${PARENT_DIR}/tests/default_databases/GratefulDeadConcerts "${ODB_DIR}/databases/" | ||
|
||
echo "cp -a ${PARENT_DIR}/tests/default_databases/VehicleHistoryGraph \"${ODB_DIR}/databases/\"" | ||
cp -a ${PARENT_DIR}/tests/default_databases/VehicleHistoryGraph "${ODB_DIR}/databases/" | ||
|
||
echo "cp ${PARENT_DIR}/ci/orientdb-distr-hazelcast.xml \"${ODB_DIR}/config/\"" | ||
cp ${PARENT_DIR}/ci/orientdb-distr-hazelcast.xml ${ODB_DIR}/config/ | ||
|
||
# Start OrientDB in background. | ||
echo "--- Starting 2 instance of OrientDB ---" | ||
CONFIG_FILE="${PARENT_DIR}/ci/orientdb-distr-node-1.xml" ${ODB_LAUNCHER} </dev/null &>/dev/null & | ||
CONFIG_FILE="${PARENT_DIR}/ci/orientdb-distr-node-2.xml" ${ODB_LAUNCHER} </dev/null &>/dev/null & | ||
# Wait a bit for OrientDB to finish the initialization phase. | ||
sleep 5 | ||
printf "\n=== The CI environment has been initialized ===\n" |