From 6ce8eadc3655674fbd9d91587caea7d4bc2968a5 Mon Sep 17 00:00:00 2001 From: Mark McFate Date: Fri, 25 Mar 2016 09:15:04 -0500 Subject: [PATCH] Adding custom.sh to implement in Mark Jordan's islandora_scg (Sample Content Generator) module. --- .gitignore | 1 - .idea/vcs.xml | 6 +++++ Vagrantfile | 22 ++++++++++++++++++- scripts/custom.sh | 56 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 .idea/vcs.xml create mode 100644 scripts/custom.sh diff --git a/.gitignore b/.gitignore index bd3a12a..68dc69f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ .vagrant downloads -scripts/custom.sh package.box diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Vagrantfile b/Vagrantfile index d110ac7..c1f0576 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -19,10 +19,30 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.hostname = $hostname + # In March 2016 numerous attempts were made to give this VM a network interface that would + # allow it to communicate with an existing, persistent, test repository. All failed for + # one reason or another, but the attempts are preserved here so that others can see what's + # been tried. + # + # MAM - This configuration, created 22-March-2016 allows RepositoryX to PING the VM! But this won't work with my VPN connection! + # config.vm.network "public_network", ip: "132.161.216.192", netmask: "255.255.0.0", bridge: "en5: AX88179 USB 3.0 to Gigabit Ethernet" + # + # MAM - Line below added to provide a public network interface on 18-March-2016 per https://www.vagrantup.com/docs/networking/public_network.html + #a config.vm.network "public_network" + # MAM - Line below added to provide a public network interface on 18-March-2016 per http://serverfault.com/questions/539251/vagrant-public-ip-not-accessible + #b config.vm.network :public_network, ip: '132.161.216.234', :netmask => '255.255.0.0', :bridge => 'eth1' + #c config.vm.network :public_network + # + # MAM - The following from https://akrabat.com/sharing-host-vpn-with-vagrant/ + #d config.vm.network :private_network + #d config.vm.provider :virtualbox do |vb| + #d vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] + #d end + # + # Every Vagrant virtual environment requires a box to build off of. config.vm.box = "islandora/islandora-base" - unless $forward.eql? "FALSE" config.vm.network :forwarded_port, guest: 8080, host: 8080 # Tomcat config.vm.network :forwarded_port, guest: 3306, host: 3306 # MySQL diff --git a/scripts/custom.sh b/scripts/custom.sh new file mode 100644 index 0000000..768d771 --- /dev/null +++ b/scripts/custom.sh @@ -0,0 +1,56 @@ +#!/bin/bash + +# custom.sh +# +# This script, authored by Peter MacDonald and Mark McFate on 24-March-2016, was patterned +# after https://github.com/Islandora-Labs/islandora_vagrant/blob/master/scripts/islandora_modules.sh. +# Several parts of the original script remain here (commented out) for reference. +# +# Changes: +# 24-Mar-2016 - Added Mark Jordan's islandora_scg (Sample Content Generator) module with +# representative content. +# + +echo "Installing Customizations" + +SHARED_DIR=$1 + +if [ -f "$SHARED_DIR/configs/variables" ]; then + # shellcheck source=/dev/null + . "$SHARED_DIR"/configs/variables +fi + +# Permissions and ownership +#sudo chown -hR vagrant:www-data "$DRUPAL_HOME"/sites/all/modules +#sudo chmod -R 755 "$DRUPAL_HOME"/sites/all/modules + +# Clone custom modules from GitHub +echo "Cloning Mark Jordan's islandora_scg Module..." +cd "$DRUPAL_HOME"/sites/all/modules || exit +git clone https://github.com/mjordan/islandora_scg +cd islandora_scg +git config core.filemode false + +# Move pdf.js drush file to user's .drush folder +#if [ -d "$HOME_DIR/.drush" ] && [ -f "$DRUPAL_HOME/sites/all/modules/islandora_pdfjs/islandora_pdfjs.drush.inc" ]; then +# mv "$DRUPAL_HOME/sites/all/modules/islandora_pdfjs/islandora_pdfjs.drush.inc" "$HOME_DIR/.drush" +#fi + +# Enable the custom modules +drush -y -u 1 en islandora_scg + +cd "$DRUPAL_HOME"/sites/all/modules || exit + +# Set variables for Islandora modules +#drush eval "variable_set('islandora_audio_viewers', array('name' => array('none' => 'none', 'islandora_videojs' => 'islandora_videojs'), 'default' => 'islandora_videojs'))" + +# Adding in Peter's SCG drush commands to create the content... +cd /var/www/drupal/sites/all/modules/islandora_scg || exit +sudo drush iscgl --user=admin --quantity=2 --content_model=islandora:collectionCModel --parent=islandora:root --namespace=icg-collection +sudo drush iscgl --user=admin --quantity=7 --content_model=islandora:sp_basic_image --parent=islandora:sp_basic_image_collection --namespace=icg-basic-image +sudo drush iscgl --user=admin --quantity=2 --content_model=islandora:sp_large_image_cmodel --parent=islandora:sp_large_image_collection --namespace=icg-large-image +sudo drush iscgl --user=admin --quantity=7 --content_model=islandora:sp_pdf --parent=islandora:sp_pdf_collection --namespace=icg-pdf +sudo drush iscgl --user=admin --quantity=2 --content_model=islandora:bookCModel --parent=islandora:bookCollection --namespace=icg-book +sudo drush iscgl --user=admin --quantity=2 --content_model=islandora:newspaperCModel --parent=islandora:newspaper_collection --namespace=icg-newspaper2 +sudo drush iscgl --user=admin --quantity=2 --content_model=islandora:newspaperPageCModel --parent=icg-newspaper2:1 --namespace=icg-newspaper-page +sudo drush iscgl --user=admin --quantity=2 --content_model=islandora:newspaperPageCModel --parent=icg-newspaper2:2 --namespace=icg-newspaper-page