Skip to content

Commit

Permalink
Adding custom.sh to implement in Mark Jordan's islandora_scg (Sample …
Browse files Browse the repository at this point in the history
…Content Generator) module.
  • Loading branch information
Digital-Grinnell authored and McFateM committed Mar 25, 2016
1 parent d95c74f commit 6ce8ead
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 2 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.vagrant
downloads
scripts/custom.sh
package.box
6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 21 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
56 changes: 56 additions & 0 deletions scripts/custom.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 6ce8ead

Please sign in to comment.