Created
May 31, 2012 14:33
-
-
Save mhluongo/2843784 to your computer and use it in GitHub Desktop.
A bit of bash we use to download Neo and install the cleandb extension on development machines.
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
#!/bin/bash | |
VERSION='1.6' | |
DIR="neo4j-community-$VERSION" | |
FILE="$DIR-unix.tar.gz" | |
SERVER_PROPERTIES_FILE="lib/neo4j/conf/neo4j-server.properties" | |
if [[ ! -d lib/$DIR ]]; then | |
wget http://dist.neo4j.org/$FILE | |
tar xvfz $FILE &> /dev/null | |
rm $FILE | |
[[ ! -d lib ]] && mkdir lib | |
mv $DIR lib/ | |
[[ -h lib/neo4j ]] && unlink lib/neo4j | |
ln -fs $DIR lib/neo4j | |
mkdir lib/neo4j/testing/ | |
DELETE_DB_PLUGIN_JAR="test-delete-db-extension-1.6.jar" | |
wget -O lib/neo4j/testing/$DELETE_DB_PLUGIN_JAR https://github.com/downloads/jexp/neo4j-clean-remote-db-addon/$DELETE_DB_PLUGIN_JAR | |
ln -s ../testing/$DELETE_DB_PLUGIN_JAR lib/neo4j/plugins/$DELETE_DB_PLUGIN_JAR | |
cat >> $SERVER_PROPERTIES_FILE <<EOF | |
org.neo4j.server.thirdparty_jaxrs_classes=org.neo4j.server.extension.test.delete=/cleandb | |
org.neo4j.server.thirdparty.delete.key=supersecretdebugkey! | |
EOF | |
fi | |
SERVER_PROPERTIES_FILE="lib/neo4j/conf/neo4j-server.properties" | |
if grep 7474 $SERVER_PROPERTIES_FILE > /dev/null; then | |
sed -i s/7474/7475/g $SERVER_PROPERTIES_FILE #change port to 7475 | |
fi |
For the unitiated, the original project structure expects a "lib" dir in the project root from which this script is run.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Obviously this needs to be generalized- eg, to other project structures. The version should also apply to the cleandb plugin, though it doesn't have an install candidate > 1.6.