Skip to content

Commit

Permalink
Add Drupal Console. Address #357 (#359)
Browse files Browse the repository at this point in the history
* Add Drupal Console. Address #357

* Address #369, #368, #358; and finally take care of #357.

* Address #374
  • Loading branch information
ruebot authored and whikloj committed Sep 20, 2016
1 parent f60a1dc commit 83cdc74
Show file tree
Hide file tree
Showing 14 changed files with 103 additions and 34 deletions.
19 changes: 3 additions & 16 deletions install/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
end

config.vm.hostname = $hostname

# THIS NEEDS SOME LOVE. WEIRD SSH LOGIN ISSUES.
# IT GETS STUCK AT: Waiting for ssh..
config.vm.provider :aws do |aws, override|
aws.access_key_id = ENV['AWS_KEY']
aws.secret_access_key = ENV['AWS_SECRET']
aws.keypair_name = ENV['AWS_KEYNAME']
aws.ami = "ami-4feaad2a"
override.vm.box = "dummy"
override.ssh.username = "ubuntu"
override.ssh.private_key_path = ENV['AWS_KEYPATH']
override.vm.network :forwarded_port, guest: 80, host: 80
end


# This should work fine out of the box if environment variables are declared
config.vm.provider :digital_ocean do |provider, override|
provider.ssh_key_name = ENV['DIGITALOCEAN_KEYNAME']
Expand Down Expand Up @@ -74,12 +61,12 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provision :shell, :path => "./scripts/solr.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/loris.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/composer.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/drupal-console.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/alpaca.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/karaf.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/islandora-karaf-components.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/fcrepo-camel-toolbox.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/config.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/post-install.sh", :args => home_dir
config.vm.provision :shell, :path => "./scripts/islandora-microservices.sh", :args => home_dir
Expand Down
48 changes: 48 additions & 0 deletions install/configs/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
application:
environment: 'prod'
language: 'en'
editor: 'vim'
temp: '/tmp'
develop: 'false'
command: 'about'
checked: 'false'
remote:
user: 'root'
port: '22'
console: '/usr/local/bin/drupal'
keys:
public: '~/.ssh/id_rsa.pub'
private: '~/.ssh/id_rsa'
passphrase: '~/.ssh/passphrase.txt'
composer:
create-project:
default:
# repository: 'https://packagist.org'
package: 'drupal-composer/drupal-project'
drupal:
# repository: 'https://packagist.org'
package: 'drupal/drupal'
repositories:
default: 'https://packagist.drupal-composer.org'
drupal: 'https://packages.drupal.org/8'
packagist: 'https://packagist.org'
disable:
modules:
# - module_name_one
# - module_name_two
commands:
# - generate:module
# - create:nodes
namespaces:
# - generate
# - create
options:
learning: false
examples: false
# target: drupalvm.dev
# uri: miltisite.dev
generate-inline: false
generate-chain: false
yes: false
composer: false
shellexec_output: true
3 changes: 3 additions & 0 deletions install/configs/karaf/fcrepo_camel_toolbox.script
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
feature:repo-add mvn:org.fcrepo.camel/toolbox-features/4.6.0/xml/features
feature:install fcrepo-service-activemq
feature:install fcrepo-indexing-triplestore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
repo-add file:/home/vagrant/Alpaca/karaf/target/classes/features.xml
repo-add file:/home/vagrant/Alpaca/karaf/build/resources/main/features.xml
feature:install islandora-indexing-triplestore
2 changes: 1 addition & 1 deletion install/configs/karaf/islandora_sync_gateway.script
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
repo-add file:/home/vagrant/Alpaca/karaf/target/classes/features.xml
repo-add file:/home/vagrant/Alpaca/karaf/build/resources/main/features.xml
feature:install islandora-sync-gateway
4 changes: 1 addition & 3 deletions install/configs/karaf/watch.script
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
bundle:watch --start mvn:ca.islandora.component/islandora-camel-component/0.0.1-SNAPSHOT
bundle:watch --start mvn:ca.islandora.sync/islandora-sync-gateway/0.0.1-SNAPSHOT
bundle:watch --start mvn:ca.islandora.indexing/islandora-indexing-triplestore/0.0.1-SNAPSHOT
bundle:watch --start mvn:ca.islandora.indexing/islandora-indexing-triplestore/0.1.0-SNAPSHOT
logout
6 changes: 3 additions & 3 deletions install/configs/variables
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

HOME_DIR=$1
DOWNLOAD_DIR="$HOME_DIR/islandora/install/downloads"
FEDORA_VERSION=4.5.1
FEDORA_VERSION=4.6.0
KARAF_VERSION=4.0.5
KARAF_DIR="/opt/karaf"
KARAF_CLIENT="$KARAF_DIR/bin/client"
Expand All @@ -12,5 +12,5 @@ SOLR_VERSION=4.10.3
SOLR_HOME="/var/lib/tomcat7/solr"
BLAZEGRAPH_VERSION=1.5.1
DRUPAL_HOME="/var/www/html/drupal"
FITS_VERSION=1.0.1
FITS_WS_VERSION=1.1.2
FITS_VERSION=1.0.2
FITS_WS_VERSION=1.1.3
3 changes: 1 addition & 2 deletions install/scripts/alpaca.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ cd "$HOME_DIR"
git clone https://github.com/Islandora-CLAW/Alpaca.git
cd Alpaca
chown -R vagrant:vagrant "$HOME_DIR/Alpaca"
sudo -u vagrant mvn -q install
sudo -u vagrant ./gradlew build

# Chown everything over to the vagrant user just in case
chown -R vagrant:vagrant "$HOME_DIR/.m2"
chown -R vagrant:vagrant "$HOME_DIR/Alpaca"
4 changes: 1 addition & 3 deletions install/scripts/config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ if [ -f "$HOME_DIR/islandora/install/configs/variables" ]; then
. "$HOME_DIR"/islandora/install/configs/variables
fi

cp "$HOME_DIR"/Alpaca/sync/src/main/cfg/ca.islandora.sync.cfg /opt/karaf/etc

if [ ! -f "$KARAF_DIR/etc/org.fcrepo.camel.indexing.triplestore.cfg" ]; then
# Wait a minute for Karaf to finish starting up
echo "$KARAF_DIR/etc/org.fcrepo.camel.indexing.triplestore.cfg doesn't exist, waiting a minute"
Expand All @@ -16,7 +14,7 @@ fi

if [ -f "$KARAF_DIR/etc/org.fcrepo.camel.indexing.triplestore.cfg" ]; then
# Update fcrepo triplestore indexing config
sed -i 's|triplestore.baseUrl=localhost:8080/fuseki/test/update|triplestore.baseUrl=localhost:8080/bigdata/sparql|' "$KARAF_DIR/etc/org.fcrepo.camel.indexing.triplestore.cfg"
sed -i 's|triplestore.baseUrl=http://localhost:8080/fuseki/test/update|triplestore.baseUrl=http://localhost:8080/bigdata/sparql|' "$KARAF_DIR/etc/org.fcrepo.camel.indexing.triplestore.cfg"
else
echo "$KARAF_DIR/etc/org.fcrepo.camel.indexing.triplestore.cfg still doesn't exist, this is an ERROR!"
fi
19 changes: 19 additions & 0 deletions install/scripts/drupal-console.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#/bin/bash

echo "Installing Drupal Console."

HOME_DIR=$1

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

sed -i '$idate.timezone=America/Toronto' /etc/php/7.0/cli/php.ini
cd /tmp
curl https://drupalconsole.com/installer -L -o drupal.phar
mv drupal.phar /usr/local/bin/drupal
chmod +x /usr/local/bin/drupal
cd /home/vagrant
mkdir .console
cp $HOME_DIR/islandora/install/configs/config.yml /home/vagrant/.console/config.yml
chown -hR vagrant:vagrant /home/vagrant/.console
5 changes: 5 additions & 0 deletions install/scripts/drupal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,8 @@ drush en -y search_api
drush -y dl bootstrap
drush -y en bootstrap
drush -y config-set system.theme default bootstrap

# Permissions
cd /var/www/html
chown -R www-data:www-data drupal
chmod -R g+w drupal
12 changes: 12 additions & 0 deletions install/scripts/fcrepo-camel-toolbox.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
echo "Installing fcrepo-camel-toolbox"

HOME_DIR=$1

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

echo "Installing fcrepo-indexing-triplestore"
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
$KARAF_CLIENT -f $KARAF_CONFIGS/fcrepo_camel_toolbox.script
2 changes: 2 additions & 0 deletions install/scripts/fcrepo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ fi
chown tomcat7:tomcat7 /var/lib/tomcat7/fcrepo4-data
chmod g-w /var/lib/tomcat7/fcrepo4-data

echo "CATALINA_OPTS=\"\${CATALINA_OPTS} -Dfcrepo.modeshape.configuration=classpath:/config/minimal-default/repository.json\"" >> /etc/default/tomcat7;

cp -v "$DOWNLOAD_DIR/fcrepo-$FEDORA_VERSION.war" /var/lib/tomcat7/webapps/fcrepo.war
chown tomcat7:tomcat7 /var/lib/tomcat7/webapps/fcrepo.war
sed -i 's#JAVA_OPTS="-Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC"#JAVA_OPTS="-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms512m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m"#g' /etc/default/tomcat7
Expand Down
8 changes: 3 additions & 5 deletions install/scripts/post-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@ chmod -R g+w /var/www/html
# Chown the home directory for good measure
chown -R vagrant:vagrant "$HOME_DIR"

# Fix FITS log
sed -i 's|log4j.appender.FILE.File=${catalina.home}/logs/fits-service.log|log4j.appender.FILE.File=/var/log/tomcat7/fits-service.log|g' /var/lib/tomcat7/webapps/fits/WEB-INF/classes/log4j.properties

# Cycle tomcat
cd /var/lib/tomcat7
service tomcat7 restart

# Cycle karaf and watch the maven bundles
service karaf-service restart
sleep 60
$KARAF_CLIENT -f $KARAF_CONFIGS/watch.script

# Fix ApacheSolr config
#drush -r "$DRUPAL_HOME" sqlq "update apachesolr_environment set url='http://localhost:8080/solr' where url='http://localhost:8983/solr'"
#drush -r "$DRUPAL_HOME" cc all

0 comments on commit 83cdc74

Please sign in to comment.