Skip to content

Instantly share code, notes, and snippets.

@djpillen
Last active January 18, 2016 17:41
Show Gist options
  • Select an option

  • Save djpillen/5afa1da38fa6f8685769 to your computer and use it in GitHub Desktop.

Select an option

Save djpillen/5afa1da38fa6f8685769 to your computer and use it in GitHub Desktop.
Setup ArchivesSpace for Archivagrant -- Part 2
# These will be used to edit the ArchivesSpace config file to use the correct database URL and setup our plugins
DBURL='AppConfig[:db_url] = "jdbc:mysql://localhost:3306/archivesspace?user=as\&password=as123\&useUnicode=true\&characterEncoding=UTF-8"'
PLUGINS="AppConfig[:plugins] = ['bhl-ead-importer','bhl-ead-exporter','container_management','aspace-jsonmodel-from-format']"
echo "Installing plugins"
cd /home/vagrant
echo "Installing container management"
# Grab a release instead of cloning the repo to make sure it's a version compatible with latest ArchivesSpace releases
wget https://github.com/hudmol/container_management/releases/download/1.1/container_management-1.1.zip
unzip container_management-1.1.zip -d /home/vagrant/archivesspace/plugins
echo "Installing BHL EAD Importer and Exporter"
cd archivesspace/plugins
git clone https://github.com/bentley-historical-library/bhl-ead-importer.git
git clone https://github.com/bentley-historical-library/bhl-ead-exporter.git
echo "Installing Mark Cooper's JSONModel from Format plugin"
git clone https://github.com/bentley-historical-library/aspace-jsonmodel-from-format.git
echo "Installing mysql java connector"
# http://archivesspace.github.io/archivesspace/user/running-archivesspace-against-mysql/
cd /home/vagrant/archivesspace/lib
wget http://central.maven.org/maven2/mysql/mysql-connector-java/5.1.37/mysql-connector-java-5.1.37.jar
echo "Editing config"
cd /home/vagrant/archivesspace/config
# Edit the config file to use the MySQL database and setup our plugins
# http://stackoverflow.com/questions/14643531/changing-contents-of-a-file-through-shell-script
sed -i "s@#AppConfig\[:db_url\].*@$DBURL@" config.rb
sed -i "s@#AppConfig\[:plugins\].*@$PLUGINS@" config.rb
echo "Setting up database and starting ArchivesSpace"
# First, make the setup-database.sh and archivesspace.sh scripts executable
cd /home/vagrant/archivesspace/scripts
chmod +x setup-database.sh
cd /home/vagrant/archivesspace
chmod +x archivesspace.sh
echo "Setting up database"
scripts/setup-database.sh
echo "Adding ArchivesSpace to system startup"
cd /etc/init.d
ln -s /home/vagrant/archivesspace/archivesspace.sh archivesspace
update-rc.d archivesspace defaults
update-rc.d archivesspace enable
cd /home/vagrant/archivesspace
echo "Starting ArchivesSpace"
./archivesspace.sh start
echo "Setting up ArchivesSpace defaults"
cd /vagrant
python archivesspace_defaults.py
echo "All done!"
echo "Point your host machine's browser to http://localhost:8080 to begin using ArchivesSpace"
echo "Use vagrant ssh to access the virtual machine"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment