cchaudier
7/13/2015 - 2:41 PM

Neo4j - Download and start Neo4j with spacial plugin on a Codeship build box

Neo4j - Download and start Neo4j with spacial plugin on a Codeship build box

#/bin/bash
VERSION="2.2.3"
VERSION_SPACIAL="0.15"

PORT_DB=7476 #7474
PORT_ADM=7475 #7473

PWD=$(pwd)
 
cd ~/
 
#Install neo4j
wget -O neo4j-community.tar.gz http://neo4j.com/artifact.php?name=neo4j-community-${VERSION}-unix.tar.gz
tar -xzf neo4j-community.tar.gz
rm -f neo4j-community.tar.gz
mv neo4j-community* neo4j-community

#Install spacial plugins
cd ~/neo4j-community/plugins
wget -O neo4j-spatial-plugin.zip https://github.com/neo4j-contrib/m2/blob/master/releases/org/neo4j/neo4j-spatial/${VERSION_SPACIAL}-neo4j-${VERSION}/neo4j-spatial-${VERSION_SPACIAL}-neo4j-${VERSION}-server-plugin.zip?raw=true 
unzip neo4j-spatial-plugin.zip

# configure neo4j to run on testing ports (7476 + 7475)
sed -i s/7474/${PORT_DB}/g ~/neo4j-community/conf/neo4j-server.properties
sed -i s/7473/${PORT_ADM}/g ~/neo4j-community/conf/neo4j-server.properties

~/neo4j-community/bin/neo4j start
 
cd $PWD