From bee671ff29db0ba50cd05b52d2516ff939b24688 Mon Sep 17 00:00:00 2001 From: Tom Wiesing Date: Thu, 8 Oct 2020 15:48:44 +0200 Subject: [PATCH] Add install_colorbox utility --- distillery/utils/README | 2 ++ distillery/utils/install_colorbox.sh | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 distillery/utils/README create mode 100644 distillery/utils/install_colorbox.sh diff --git a/distillery/utils/README b/distillery/utils/README new file mode 100644 index 0000000..8613aba --- /dev/null +++ b/distillery/utils/README @@ -0,0 +1,2 @@ +Files in this folder are utility scripts to be used from within individual WissKI instances. +They are mounted under /utils/ and should be used with care. diff --git a/distillery/utils/install_colorbox.sh b/distillery/utils/install_colorbox.sh new file mode 100644 index 0000000..9e1209a --- /dev/null +++ b/distillery/utils/install_colorbox.sh @@ -0,0 +1,22 @@ +#!/bin/bash +set -e + +# make a temporary directory and cd into it +TEMPDIR=$(mktemp -d) +pushd "$TEMPDIR" + +# curl the colorbox zip and unpack it +curl -L https://github.com/jackmoore/colorbox/archive/master.zip --output master.zip +unzip master.zip + +# make the directory for libraries, and remove the old colorbox installation +chmod u+rw /var/www/data/project/web/sites/default/ +mkdir -p /var/www/data/project/web/sites/default/libraries/ +rm -rf /var/www/data/project/web/sites/default/libraries/colorbox + +# copy over the new installation +mv colorbox-master/ /var/www/data/project/web/sites/default/libraries/colorbox + +# cleanup +popd +rm -rf "$TEMPDIR"