Skip to content

Commit

Permalink
vagrant working using travis files
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Wilson committed Mar 31, 2016
1 parent ea4c536 commit 84d98ad
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 19 deletions.
20 changes: 17 additions & 3 deletions CI/gremlin-server/install.sh
Expand Up @@ -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
Expand All @@ -11,14 +25,14 @@ 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
bin/gremlin-server.sh -i org.apache.tinkerpop neo4j-gremlin $GREMLINSERVER_VERSION-incubating

# 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
42 changes: 41 additions & 1 deletion 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
Expand All @@ -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
1 change: 0 additions & 1 deletion CI/neo4j/install.sh
@@ -1,5 +1,4 @@
#!/bin/bash

export NEO4J_VERSION="2.2.4"

# Add environment java vars
Expand Down
18 changes: 4 additions & 14 deletions Vagrantfile
Expand Up @@ -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"
Expand Down

0 comments on commit 84d98ad

Please sign in to comment.