Skip to content

Instantly share code, notes, and snippets.

@mhluongo
Created May 31, 2012 14:33
Show Gist options
  • Save mhluongo/2843784 to your computer and use it in GitHub Desktop.
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.
#!/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
@mhluongo
Copy link
Author

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.

@mhluongo
Copy link
Author

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