From 84d98ad36fba3d34e3039b8fb987e20babc60faf Mon Sep 17 00:00:00 2001 From: Michael Wilson Date: Thu, 31 Mar 2016 12:39:59 -0500 Subject: [PATCH] vagrant working using travis files --- CI/gremlin-server/install.sh | 20 ++++++++++++++--- CI/jdk8-install.sh | 42 +++++++++++++++++++++++++++++++++++- CI/neo4j/install.sh | 1 - Vagrantfile | 18 ++++------------ 4 files changed, 62 insertions(+), 19 deletions(-) diff --git a/CI/gremlin-server/install.sh b/CI/gremlin-server/install.sh index edf38cb..ad5200b 100755 --- a/CI/gremlin-server/install.sh +++ b/CI/gremlin-server/install.sh @@ -2,6 +2,20 @@ export GREMLINSERVER_VERSION="3.0.2" +# Load the Vagrant context if there is none present +if [ -z ${TRAVIS_BUILD_DIR+x} ] + then + # Using vagrant + export BUILD_DIR="/home/vagrant" + export SPIDER_DIR="/vagrant" + +else + # Using Travis UPDATE + export SPIDER_DIR=${TRAVIS_BUILD_DIR} + export BUILD_DIR=${TRAVIS_BUILD_DIR} +fi + + # Add environment java vars export JAVA_HOME=/usr/lib/jvm/java-8-oracle export JRE_HOME=/usr/lib/jvm/java-8-oracle @@ -11,8 +25,8 @@ wget --no-check-certificate -O $HOME/apache-gremlin-server-$GREMLINSERVER_VERSIO unzip $HOME/apache-gremlin-server-$GREMLINSERVER_VERSION-incubating-bin.zip -d $HOME/ # get gremlin-server configuration files -cp ./CI/gremlin-server/gremlin-spider-script.groovy $HOME/apache-gremlin-server-$GREMLINSERVER_VERSION-incubating/scripts/ -cp ./CI/gremlin-server/gremlin-server-spider.yaml $HOME/apache-gremlin-server-$GREMLINSERVER_VERSION-incubating/conf/ +cp $SPIDER_DIR/CI/gremlin-server/gremlin-spider-script.groovy $HOME/apache-gremlin-server-$GREMLINSERVER_VERSION-incubating/scripts/ +cp $SPIDER_DIR/CI/gremlin-server/gremlin-server-spider.yaml $HOME/apache-gremlin-server-$GREMLINSERVER_VERSION-incubating/conf/ # get neo4j dependencies cd $HOME/apache-gremlin-server-$GREMLINSERVER_VERSION-incubating @@ -20,5 +34,5 @@ bin/gremlin-server.sh -i org.apache.tinkerpop neo4j-gremlin $GREMLINSERVER_VERSI # Start gremlin-server in the background and wait for it to be available bin/gremlin-server.sh conf/gremlin-server-spider.yaml > /dev/null 2>&1 & -cd $TRAVIS_BUILD_DIR +cd $BUILD_DIR sleep 30 diff --git a/CI/jdk8-install.sh b/CI/jdk8-install.sh index ea073e4..a57bb6c 100755 --- a/CI/jdk8-install.sh +++ b/CI/jdk8-install.sh @@ -1,11 +1,34 @@ #!/bin/bash +#################### ONLY FOR NOW ##################### +# Load the Vagrant context if there is none present +if [ -z ${TRAVIS_BUILD_DIR+x} ] + then + # Using vagrant + ### INSTALL PHP AND TOOLS ### + sudo apt-get update #> /dev/null + apt-get install software-properties-common python-software-properties -y #> /dev/null + add-apt-repository ppa:ondrej/php5-5.6 -y #> /dev/null + apt-get update #> /dev/null + + apt-get install php5 -y #> /dev/null + + sudo apt-get install curl php5-curl php5-gd php5-mcrypt -y #> /dev/null + sudo apt-get install php5-xdebug #> /dev/null + + curl --silent https://getcomposer.org/installer | php #> /dev/null 2>&1 + mv composer.phar /usr/local/bin/composer + + alias phpunit=/vagrant/vendor/bin/phpunit +fi +#################### ONLY FOR NOW ##################### + + sudo apt-get update apt-get install software-properties-common python-software-properties -y sudo add-apt-repository -y ppa:webupd8team/java sudo apt-get update - ## Install oracle jdk 8 # no interaction echo debconf shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections @@ -20,3 +43,20 @@ sudo update-alternatives --auto javac ## add to environment export JAVA_HOME=/usr/lib/jvm/java-8-oracle export JRE_HOME=/usr/lib/jvm/java-8-oracle + + + +######## OLD TRAVIS WAY ############## +## Get dependencies (for adding repos) +#sudo apt-get install -y python-software-properties +#sudo add-apt-repository -y ppa:webupd8team/java +#sudo apt-get update +# +## install oracle jdk 8 +#sudo apt-get install -y oracle-java8-installer +#sudo update-alternatives --auto java +#sudo update-alternatives --auto javac +# +## Add to environment +#export JAVA_HOME=/usr/lib/jvm/java-8-oracle +#export JRE_HOME=/usr/lib/jvm/java-8-oracle diff --git a/CI/neo4j/install.sh b/CI/neo4j/install.sh index 669562d..3e736d0 100755 --- a/CI/neo4j/install.sh +++ b/CI/neo4j/install.sh @@ -1,5 +1,4 @@ #!/bin/bash - export NEO4J_VERSION="2.2.4" # Add environment java vars diff --git a/Vagrantfile b/Vagrantfile index 3a26d9e..4ac9d60 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -20,21 +20,11 @@ Vagrant.configure(2) do |config| v.customize ["modifyvm", :id, "--natdnsproxy1", "on"] end - - - - - + # Provision the Machine config.vm.provision :shell, inline: "sh -c /vagrant/CI/jdk8-install.sh" - #config.vm.provision :shell, inline: "sh -c ./CI/gremlin-server/install.sh" - #config.vm.provision :shell, inline: "sh -c ./CI/neo4j/install.sh" - #config.vm.provision :shell, inline: "sh -c ./CI/orient/install.sh" - - - - - # Install test databases when building machine - #config.vm.provision :shell, path: "./myci/provision.sh" + config.vm.provision :shell, inline: "sh -c /vagrant/CI/neo4j/install.sh" + config.vm.provision :shell, inline: "sh -c /vagrant/CI/orient/install.sh" + config.vm.provision :shell, inline: "sh -c /vagrant/CI/gremlin-server/install.sh" # Start databases every time #config.vm.provision :shell, path: "./myci/startup.sh", run: "always"