|
| 1 | +#!/bin/bash |
| 2 | +set -ex |
| 3 | +BASE_PATH=$(pwd) |
| 4 | +E_UNREACHABLE=86 |
| 5 | + |
| 6 | +# skip hhvm |
| 7 | +if [[ $TRAVIS_PHP_VERSION = "hhv"* ]]; then |
| 8 | + exit 0 |
| 9 | +fi |
| 10 | + |
| 11 | +if [ "$FOURSTORE" != "" ] || [ "$VIRTUOSO" != "" ] || [ "$SESAME" != "" ] || [[ "$FUSEKI" == "2."* ]] |
| 12 | +then |
| 13 | + sudo apt-get update -qq |
| 14 | +fi |
| 15 | + |
| 16 | +# Version 1.1.0 is available and testable on Travis/SMW |
| 17 | +if [ "$FUSEKI" != "" ] |
| 18 | +then |
| 19 | + # Archive |
| 20 | + # http://archive.apache.org/dist/jena/binaries/jena-fuseki-$FUSEKI-distribution.tar.gz |
| 21 | + # http://www.eu.apache.org/dist/jena/binaries/jena-fuseki-$FUSEKI-distribution.tar.gz |
| 22 | + |
| 23 | + # Avoid ERROR 503: Service Unavailable |
| 24 | + # wget http://archive.apache.org/dist/jena/binaries/jena-fuseki-$FUSEKI-distribution.tar.gz |
| 25 | + |
| 26 | + if [[ "$FUSEKI" == "2."* ]] |
| 27 | + then |
| 28 | + |
| 29 | + # Fuseki requires Java8 for Fuseki2 v2.3.0 onwards |
| 30 | + sudo apt-get install oracle-java8-installer |
| 31 | + |
| 32 | + export JAVA_HOME="/usr/lib/jvm/java-8-oracle"; |
| 33 | + export PATH="$PATH:/usr/lib/jvm/java-8-oracle/bin"; |
| 34 | + export java_path="/usr/lib/jvm/java-8-oracle/jre/bin/java"; |
| 35 | + |
| 36 | + wget https://github.com/mwjames/travis-support/raw/master/fuseki/$FUSEKI/apache-jena-fuseki-$FUSEKI.tar.gz |
| 37 | + |
| 38 | + # option z caused "gzip: stdin: not in gzip format" |
| 39 | + tar -xf apache-jena-fuseki-$FUSEKI.tar.gz |
| 40 | + mv apache-jena-fuseki-$FUSEKI fuseki |
| 41 | + else |
| 42 | + wget https://github.com/mwjames/travis-support/raw/master/fuseki/$FUSEKI/jena-fuseki-$FUSEKI-distribution.tar.gz |
| 43 | + |
| 44 | + tar -zxf jena-fuseki-$FUSEKI-distribution.tar.gz |
| 45 | + mv jena-fuseki-$FUSEKI fuseki |
| 46 | + fi |
| 47 | + |
| 48 | + cd fuseki |
| 49 | + |
| 50 | + ## Start fuseki in-memory as background |
| 51 | + bash fuseki-server --update --mem /db &>/dev/null & |
| 52 | +fi |
| 53 | + |
| 54 | +if [ "$SESAME" != "" ] |
| 55 | +then |
| 56 | + TOMCAT_VERSION=tomcat6 |
| 57 | + sudo java -version |
| 58 | + |
| 59 | + sudo apt-get install $TOMCAT_VERSION |
| 60 | + |
| 61 | + CATALINA_BASE=/var/lib/$TOMCAT_VERSION |
| 62 | + CATALINA_HOME=/usr/share/$TOMCAT_VERSION |
| 63 | + |
| 64 | + sudo chown $USER -R $CATALINA_BASE/ |
| 65 | + sudo chmod g+rw -R $CATALINA_BASE/ |
| 66 | + |
| 67 | + sudo mkdir -p $CATALINA_HOME/.aduna |
| 68 | + sudo chown -R $TOMCAT_VERSION:$TOMCAT_VERSION $CATALINA_HOME |
| 69 | + |
| 70 | + # One method to get the war files |
| 71 | + # wget http://search.maven.org/remotecontent?filepath=org/openrdf/sesame/sesame-http-server/$SESAME/sesame-http-server-$SESAME.war -O openrdf-sesame.war |
| 72 | + # wget http://search.maven.org/remotecontent?filepath=org/openrdf/sesame/sesame-http-workbench/$SESAME/sesame-http-workbench-$SESAME.war -O openrdf-workbench.war |
| 73 | + # cp *.war /var/lib/tomcat6/webapps/ |
| 74 | + |
| 75 | + # http://sourceforge.net/projects/sesame/ |
| 76 | + # Unreliable sourceforge.net download |
| 77 | + # wget http://downloads.sourceforge.net/project/sesame/Sesame%202/$SESAME/openrdf-sesame-$SESAME-sdk.zip |
| 78 | + wget https://github.com/mwjames/travis-support/raw/master/sesame/$SESAME/openrdf-sesame-$SESAME-sdk.zip |
| 79 | + |
| 80 | + # tar caused a lone zero block, using zip instead |
| 81 | + unzip -q openrdf-sesame-$SESAME-sdk.zip |
| 82 | + cp openrdf-sesame-$SESAME/war/*.war $CATALINA_BASE/webapps/ |
| 83 | + |
| 84 | + sudo service $TOMCAT_VERSION restart |
| 85 | + ps -ef | grep tomcat |
| 86 | + |
| 87 | + sleep 5 |
| 88 | + |
| 89 | + if curl --output /dev/null --silent --head --fail "http://localhost:8080/openrdf-sesame" |
| 90 | + #if curl --output /dev/null --silent --head --fail "http://localhost:8080/openrdf-sesame/home/overview.view" |
| 91 | + then |
| 92 | + echo "openrdf-sesame service url is reachable" |
| 93 | + else |
| 94 | + echo "openrdf-sesame service url is not reachable" |
| 95 | + sudo cat $CATALINA_BASE/logs/*.log & |
| 96 | + sudo cat $CATALINA_BASE/logs/catalina.out & |
| 97 | + exit $E_UNREACHABLE |
| 98 | + fi |
| 99 | + |
| 100 | + ./openrdf-sesame-$SESAME/bin/console.sh < $BASE_PATH/scripts/travis/openrdf-sesame-memory-repository.txt |
| 101 | +fi |
| 102 | + |
| 103 | +# Version 1.1.4-1 is available but has a problem |
| 104 | +# https://github.com/garlik/4store/issues/110 |
| 105 | +# 4STORE can not be used as variable name therefore FOURSTORE |
| 106 | +if [ "$FOURSTORE" != "" ] |
| 107 | +then |
| 108 | + |
| 109 | + sudo mkdir /var/lib/4store/ |
| 110 | + sudo mkdir /var/lib/4store/db |
| 111 | + sudo chown $USER -R /var/lib/4store/ |
| 112 | + sudo chmod g+rw -R /var/lib/4store/ |
| 113 | + |
| 114 | + sudo apt-get install 4store=$FOURSTORE |
| 115 | + |
| 116 | + ## Disabling the firewall |
| 117 | + sudo iptables -F |
| 118 | + |
| 119 | + 4s-backend-setup db |
| 120 | + 4s-backend db |
| 121 | + |
| 122 | + ## Output the current process table |
| 123 | + ps auwwx | grep 4s- |
| 124 | + |
| 125 | + ## -D only used to check the status of the 4store instance |
| 126 | + ## 4s-httpd -D -p 8088 db |
| 127 | + |
| 128 | + 4s-httpd -p 8088 db |
| 129 | +fi |
| 130 | + |
| 131 | +# We build all Virtuoso version from scratch |
| 132 | +if [[ "$VIRTUOSO" != "" ]] |
| 133 | +then |
| 134 | + sudo apt-get install libssl-dev -q |
| 135 | + sudo apt-get install autoconf automake bison flex gawk gperf libtool -q |
| 136 | + |
| 137 | + if [[ -f virtuoso-opensource/$VIRTUOSO/binsrc/virtuoso/virtuoso-t ]] |
| 138 | + then |
| 139 | + echo "use cached virtuoso-opensource" |
| 140 | + cd virtuoso-opensource/$VIRTUOSO |
| 141 | + else |
| 142 | + #git clone git://github.com/openlink/virtuoso-opensource.git |
| 143 | + #cd virtuoso-opensource |
| 144 | + #git pull origin stable/7 |
| 145 | + wget --no-check-certificate -q https://github.com/openlink/virtuoso-opensource/archive/v$VIRTUOSO.zip -O virtuoso-opensource.zip |
| 146 | + |
| 147 | + unzip -q virtuoso-opensource.zip |
| 148 | + rm -r virtuoso-opensource/$VIRTUOSO || true |
| 149 | + mv virtuoso-opensource-$VIRTUOSO virtuoso-opensource/$VIRTUOSO |
| 150 | + |
| 151 | + cd virtuoso-opensource/$VIRTUOSO |
| 152 | + ./autogen.sh |
| 153 | + |
| 154 | + # --disable-all-vads: This parameter disables building all the VAD packages (tutorials, demos, etc.). |
| 155 | + # --with-readline: This parameter is used so that the system Readline library is used |
| 156 | + # --program-transform-name: Both Virtuoso and unixODBC install a program named isql. Use this parameter to rename virtuosos program to isql-v |
| 157 | + |
| 158 | + ./configure --program-transform-name="s/isql/isql-v/" --with-readline --disable-all-vads |& tee #configure.log |
| 159 | + |
| 160 | + # Only output error and warnings |
| 161 | + make > /dev/null |
| 162 | + fi |
| 163 | + |
| 164 | + # Build tree to start the automated test suite |
| 165 | + # make check |
| 166 | + |
| 167 | + sudo make install |
| 168 | + |
| 169 | + ## For Virtuoso |
| 170 | + #export PATH=$PATH:/usr/local/virtuoso-opensource/bin |
| 171 | + |
| 172 | + sudo /usr/local/virtuoso-opensource/bin/virtuoso-t -f -c /usr/local/virtuoso-opensource/var/lib/virtuoso/db/virtuoso.ini & |
| 173 | + #sudo /usr/local/virtuoso-opensource/bin/virtuoso-t -f & |
| 174 | + |
| 175 | + sleep 15 |
| 176 | + |
| 177 | + sudo /usr/local/virtuoso-opensource/bin/isql-v 1111 dba dba $BASE_PATH/scripts/travis/virtuoso-sparql-permission.sql |
| 178 | + |
| 179 | + # configure datasource name for ODBC connection |
| 180 | + echo "[VOS]" | sudo tee -a /etc/odbc.ini > /dev/null |
| 181 | + echo "Driver=/usr/local/virtuoso-opensource/lib/virtodbc.so" | sudo tee -a /etc/odbc.ini > /dev/null |
| 182 | + echo "Description=Virtuoso OpenSource Edition" | sudo tee -a /etc/odbc.ini > /dev/null |
| 183 | + echo "Address=localhost:1111" | sudo tee -a /etc/odbc.ini > /dev/null |
| 184 | +fi |
| 185 | + |
| 186 | +#@see http://wiki.blazegraph.com/wiki/index.php/NanoSparqlServer |
| 187 | +if [ "$BLAZEGRAPH" != "" ] |
| 188 | +then |
| 189 | + #sudo apt-get install tomcat6 |
| 190 | + |
| 191 | + #sudo chown $USER -R /var/lib/tomcat6/ |
| 192 | + #sudo chmod g+rw -R /var/lib/tomcat6/ |
| 193 | + |
| 194 | + #sudo mkdir -p /usr/share/tomcat6/.aduna |
| 195 | + #sudo chown -R tomcat6:tomcat6 /usr/share/tomcat6 |
| 196 | + |
| 197 | + # http://sourceforge.net/projects/bigdata/ |
| 198 | + #wget http://downloads.sourceforge.net/project/bigdata/bigdata/$BLAZEGRAPH/bigdata.war |
| 199 | + |
| 200 | + #cp bigdata.war /var/lib/tomcat6/webapps/ |
| 201 | + #export JAVA_OPTS="-server -Xmx2g -Dcom.bigdata.rdf.sail.webapp.ConfigParams.propertyFile="$BASE_PATH/scripts/travis/blazegraph-store.properties |
| 202 | + |
| 203 | + #sudo service tomcat6 restart |
| 204 | + #sleep 3 |
| 205 | + |
| 206 | + #Using the jar |
| 207 | + # Unreliable sourceforge.net download |
| 208 | + # wget http://downloads.sourceforge.net/project/bigdata/bigdata/$BLAZEGRAPH/bigdata-bundled.jar |
| 209 | + wget https://github.com/mwjames/travis-support/raw/master/blazegraph/$BLAZEGRAPH/bigdata-bundled.jar |
| 210 | + |
| 211 | + java -server -Xmx4g -Dbigdata.propertyFile=$BASE_PATH/scripts/travis/blazegraph-store.properties -jar bigdata-bundled.jar &>/dev/null & |
| 212 | + sleep 5 |
| 213 | + |
| 214 | + if curl --output /dev/null --silent --head --fail "http://localhost:9999/bigdata" |
| 215 | + then |
| 216 | + echo "blazegraph service url is reachable" |
| 217 | + else |
| 218 | + echo "blazegraph service url is not reachable" |
| 219 | + exit $E_UNREACHABLE |
| 220 | + fi |
| 221 | + |
| 222 | +fi |
0 commit comments