Skip to content

Commit

Permalink
Large refactor of Vagrant installation. How about we cache downloads …
Browse files Browse the repository at this point in the history
…now too?
  • Loading branch information
ruebot committed Aug 10, 2015
1 parent 6ee8e27 commit b7beb39
Show file tree
Hide file tree
Showing 43 changed files with 310 additions and 285 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ cache.properties
.DS_Store
tests/test_config.ini
install/.vagrant
install/downloads
site/
148 changes: 21 additions & 127 deletions install/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.

config.vm.provider "virtualbox" do |v|
v.name = "Islandora 7.x-2.x"
end
config.vm.hostname = "islandora"

# Every Vagrant virtual environment requires a box to build off of.
Expand All @@ -28,130 +30,22 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
vb.customize ["modifyvm", :id, "--memory", '2048']
end

config.vm.provision :shell, :path => "bootstrap.sh", :args => home_dir
config.vm.provision :shell, :path => "solr.sh"
config.vm.provision :shell, :path => "drupal.sh", :args => home_dir
config.vm.provision :shell, :path => "fcrepo.sh", :args => home_dir
config.vm.provision :shell, :path => "blazegraph.sh"
config.vm.provision :shell, :path => "fcrepo-camel-toolbox.sh"
config.vm.provision :shell, :path => "islandora-commands.sh", :args => home_dir
config.vm.provision :shell, :path => "karaf.sh", :args => home_dir
config.vm.provision :shell, :path => "hawtio.sh", :args => home_dir
config.vm.provision :shell, :path => "camel.sh", :args => home_dir
config.vm.provision :shell, :path => "fcrepo-camel.sh", :args => home_dir
config.vm.provision :shell, :path => "activemq.sh", :args => home_dir
config.vm.provision :shell, :path => "config.sh", :args => home_dir
config.vm.provision :shell, :path => "islandora-component.sh", :args => home_dir
config.vm.provision :shell, :path => "sync.sh", :args => home_dir
config.vm.provision :shell, :path => "services.sh", :args => home_dir
config.vm.provision :shell, :path => "post-install.sh", :args => home_dir


# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false

# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# config.vm.network "forwarded_port", guest: 80, host: 8080

# Create a private network, which allows host-only access to the machine
# using a specific IP.
# config.vm.network "private_network", ip: "192.168.33.10"

# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"

# If true, then any SSH connections made will enable agent forwarding.
# Default value: false
# config.ssh.forward_agent = true

# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"

# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
# config.vm.provider "virtualbox" do |vb|
# # Don't boot with headless mode
# vb.gui = true
#
# # Use VBoxManage to customize the VM. For example to change memory:
# vb.customize ["modifyvm", :id, "--memory", "1024"]
# end
#
# View the documentation for the provider you're using for more
# information on available options.

# Enable provisioning with CFEngine. CFEngine Community packages are
# automatically installed. For example, configure the host as a
# policy server and optionally a policy file to run:
#
# config.vm.provision "cfengine" do |cf|
# cf.am_policy_hub = true
# # cf.run_file = "motd.cf"
# end
#
# You can also configure and bootstrap a client to an existing
# policy server:
#
# config.vm.provision "cfengine" do |cf|
# cf.policy_server_address = "10.0.2.15"
# end

# Enable provisioning with Puppet stand alone. Puppet manifests
# are contained in a directory path relative to this Vagrantfile.
# You will need to create the manifests directory and a manifest in
# the file default.pp in the manifests_path directory.
#
# config.vm.provision "puppet" do |puppet|
# puppet.manifests_path = "manifests"
# puppet.manifest_file = "default.pp"
# end

# Enable provisioning with chef solo, specifying a cookbooks path, roles
# path, and data_bags path (all relative to this Vagrantfile), and adding
# some recipes and/or roles.
#
# config.vm.provision "chef_solo" do |chef|
# chef.cookbooks_path = "../my-recipes/cookbooks"
# chef.roles_path = "../my-recipes/roles"
# chef.data_bags_path = "../my-recipes/data_bags"
# chef.add_recipe "mysql"
# chef.add_role "web"
#
# # You may also specify custom JSON attributes:
# chef.json = { mysql_password: "foo" }
# end

# Enable provisioning with chef server, specifying the chef server URL,
# and the path to the validation key (relative to this Vagrantfile).
#
# The Opscode Platform uses HTTPS. Substitute your organization for
# ORGNAME in the URL and validation key.
#
# If you have your own Chef Server, use the appropriate URL, which may be
# HTTP instead of HTTPS depending on your configuration. Also change the
# validation key to validation.pem.
#
# config.vm.provision "chef_client" do |chef|
# chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME"
# chef.validation_key_path = "ORGNAME-validator.pem"
# end
#
# If you're using the Opscode platform, your validator client is
# ORGNAME-validator, replacing ORGNAME with your organization name.
#
# If you have your own Chef Server, the default validation client name is
# chef-validator, unless you changed the configuration.
#
# chef.validation_client_name = "ORGNAME-validator"
config.vm.provision :shell, inline: "sudo sed -i '/tty/!s/mesg n/tty -s \\&\\& mesg n/' /root/.profile", :privileged =>false
config.vm.provision :shell, :path => "./scripts/bootstrap.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/solr.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/drupal.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/fcrepo.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/blazegraph.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/fcrepo-camel-toolbox.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/islandora-commands.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/karaf.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/hawtio.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/camel.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/fcrepo-camel.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/activemq.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/config.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/islandora-component.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/sync.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/services.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/post-install.sh", :args => home_dir
end
5 changes: 0 additions & 5 deletions install/activemq.sh

This file was deleted.

12 changes: 0 additions & 12 deletions install/blazegraph.sh

This file was deleted.

5 changes: 0 additions & 5 deletions install/camel.sh

This file was deleted.

5 changes: 0 additions & 5 deletions install/config.sh

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions install/configs/variables
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

HOME_DIR=$1
DOWNLOAD_DIR="$HOME_DIR/islandora/install/downloads"
FEDORA_VERSION=4.3.0
KARAF_VERSION=3.0.4
KARAF_CLIENT="/opt/karaf/bin/client"
KARAF_CONFIGS="$HOME_DIR/islandora/install/configs/karaf/"
CAMEL_VERSION=4.2.0
SOLR_VERSION=4.10.3
SOLR_HOME="/var/lib/tomcat7/solr"
KARAF_VERSION=3.0.4
BLAZEGRAPH_VERSION=1.5.1
DRUPAL_HOME="/var/www/html/drupal"
12 changes: 0 additions & 12 deletions install/disable_node_access.php

This file was deleted.

13 changes: 0 additions & 13 deletions install/fcrepo-camel-toolbox.sh

This file was deleted.

5 changes: 0 additions & 5 deletions install/fcrepo-camel.sh

This file was deleted.

16 changes: 0 additions & 16 deletions install/fcrepo.sh

This file was deleted.

3 changes: 0 additions & 3 deletions install/hawtio.sh

This file was deleted.

11 changes: 0 additions & 11 deletions install/islandora-component.sh

This file was deleted.

9 changes: 9 additions & 0 deletions install/scripts/activemq.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
echo "Installing ActiveMQ"

HOME_DIR=$1
if [ -f "$HOME_DIR/islandora/install/configs/variables" ]; then
. "$HOME_DIR"/islandora/install/configs/variables
fi

"$KARAF_CLIENT" < "$KARAF_CONFIGS/activemq.script"
23 changes: 23 additions & 0 deletions install/scripts/blazegraph.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
echo "Installing BlazeGraph's NanoSparqlServer"

HOME_DIR=$1

if [ -f "$HOME_DIR/islandora/install/configs/variables" ]; then
. "$HOME_DIR"/islandora/install/configs/variables
fi

if [ ! -f "$DOWNLOAD_DIR/bigdata.war" ]; then
echo "Downloading Blazegraph"
wget -q -O "$DOWNLOAD_DIR/bigdata.war" "http://sourceforge.net/projects/bigdata/files/bigdata/$BLAZEGRAPH_VERSION/bigdata.war/download"
fi

cd /var/lib/tomcat7/webapps
cp -v "$DOWNLOAD_DIR/bigdata.war" "/var/lib/tomcat7/webapps"
chown tomcat7:tomcat7 /var/lib/tomcat7/webapps/bigdata.war

if [ $(grep -c 'com.bigdata.rdf.sail.webapp' /etc/default/tomcat7) -eq 0 ]; then
echo "JAVA_OPTS=\"\$JAVA_OPTS -Dcom.bigdata.rdf.sail.webapp.ConfigParams.propertyFile=/var/lib/tomcat7/webapps/bigdata/WEB-INF/RWStore.properties\"" >> /etc/default/tomcat7
fi

service tomcat7 restart
30 changes: 23 additions & 7 deletions install/bootstrap.sh → install/scripts/bootstrap.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
###
# BASICS
###
#!/bin/bash

HOME_DIR=$1

cd $HOME_DIR
if [ -f "$HOME_DIR/islandora/install/configs/variables" ]; then
. "$HOME_DIR"/islandora/install/configs/variables
fi

if [ ! -d "$DOWNLOAD_DIR" ]; then
mkdir -p "$DOWNLOAD_DIR"
fi

cd "$HOME_DIR"

# Set apt-get for non-interactive mode
export DEBIAN_FRONTEND=noninteractive

# Update
apt-get -y update && apt-get -y upgrade
Expand All @@ -19,7 +28,6 @@ apt-get -y install build-essential
apt-get -y install git vim

# Java
# apt-get -y install openjdk-7-jdk
## There is no Java8 OpenJDK right now in the Ubuntu repos
## http://askubuntu.com/questions/464755/how-to-install-openjdk-8-on-14-04-lts
## We'll use Oracle Java8 for now.
Expand All @@ -45,12 +53,21 @@ usermod -a -G tomcat7 vagrant
sed -i '$i<user username="islandora" password="islandora" roles="manager-gui"/>' /etc/tomcat7/tomcat-users.xml

# Make the ingest directory
mkdir /mnt/ingest
if [ ! -d "/mnt/ingest" ]; then
mkdir /mnt/ingest
fi

chown -R tomcat7:tomcat7 /mnt/ingest

# Wget and curl
apt-get -y install wget curl

# Bug fix for Ubuntu 14.04 with zsh 5.0.2 -- https://bugs.launchpad.net/ubuntu/+source/zsh/+bug/1242108
export MAN_FILES
MAN_FILES=$(wget -qO- "http://sourceforge.net/projects/zsh/files/zsh/5.0.2/zsh-5.0.2.tar.gz/download" \
| tar xvz -C /usr/share/man/man1/ --wildcards "zsh-5.0.2/Doc/*.1" --strip-components=2)
for MAN_FILE in $MAN_FILES; do gzip /usr/share/man/man1/"${MAN_FILE##*/}"; done

# More helpful packages
apt-get -y install htop tree zsh fish

Expand All @@ -65,7 +82,6 @@ tasksel install lamp-server
usermod -a -G www-data vagrant

# Get the repo
#git clone -b 7.x-2.x https://github.com/Islandora-Labs/islandora.git
chown -R vagrant:vagrant islandora

# Set JAVA_HOME -- Java8 set-default does not seem to do this.
Expand Down
9 changes: 9 additions & 0 deletions install/scripts/camel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
echo "Installing Camel"

HOME_DIR=$1
if [ -f "$HOME_DIR/islandora/install/configs/variables" ]; then
. "$HOME_DIR"/islandora/install/configs/variables
fi

"$KARAF_CLIENT" < "$KARAF_CONFIGS/camel.script"
9 changes: 9 additions & 0 deletions install/scripts/config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
echo "Deploying Karaf Configuration"

HOME_DIR=$1
if [ -f "$HOME_DIR/islandora/install/configs/variables" ]; then
. "$HOME_DIR"/islandora/install/configs/variables
fi

cp "$HOME_DIR"/islandora/camel/config/islandora.cfg /opt/karaf/etc
Loading

0 comments on commit b7beb39

Please sign in to comment.