Skip to content

Instantly share code, notes, and snippets.

@dannylamb
Created July 16, 2020 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dannylamb/384686ae2e49b67e73c50b1eea340b3e to your computer and use it in GitHub Desktop.
Save dannylamb/384686ae2e49b67e73c50b1eea340b3e to your computer and use it in GitHub Desktop.
#!/bin/bash
service karaf stop
# Back up the data directoyr just in case
tar -czvf ~/data.tar.gz /opt/karaf/data
rm -rf /opt/karaf/data/*
# Temporarily move out the blueprint files and sed them to use
# 'broker' instead of 'activemq'
mv /opt/karaf/deploy/ca.islandora* ~
sed -i 's/activemq/broker/g' ~/ca.islandora*
service karaf start
# Add the features repos back in
ALPACA_VERSION=1.0.3
ACTIVEMQ_VERSION=5.15.0
CAMEL_VERSION=2.20.4
/opt/karaf/bin/client -r 10 -d 5 "feature:repo-add mvn:ca.islandora.alpaca/islandora-karaf/${ALPACA_VERSION}/xml/features"
/opt/karaf/bin/client -r 10 -d 5 "feature:repo-add mvn:org.apache.activemq/activemq-karaf/${ACTIVEMQ_VERSION}/xml/features"
/opt/karaf/bin/client -r 10 -d 5 "feature:repo-add mvn:org.apache.camel.karaf/apache-camel/${CAMEL_VERSION}/xml/features"
# Install and configure the activemq consumer
/opt/karaf/bin/client -r 10 -d 5 "feature:install fcrepo-service-activemq"
cat >/opt/karaf/etc/org.fcrepo.camel.service.activemq.cfg <<EOL
jms.brokerUrl = ssl://b-d1b6e5c3-d4ba-4f96-9aab-15b789c0ab17-1.mq.us-east-1.amazonaws.com:61617
jms.password = islandora_mq
jms.username = islandora_mq
EOL
# Re-install the rest of the features
/opt/karaf/bin/client -r 10 -d 5 "feature:install fcrepo-service-camel"
/opt/karaf/bin/client -r 10 -d 5 "feature:install islandora-http-client"
/opt/karaf/bin/client -r 10 -d 5 "feature:install islandora-connector-derivative"
/opt/karaf/bin/client -r 10 -d 5 "feature:install islandora-indexing-triplestore"
# Move the blueprints back to kick off derivative generation again
mv ~/ca.islandora* /opt/karaf/deploy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment