Skip to content

Commit

Permalink
Demo image to use islandora install profile (#209)
Browse files Browse the repository at this point in the history
Co-authored-by: Rosie Le Faive <lefaive@gmail.com>
Co-authored-by: dannylamb <dlamb@islandora.ca>

Co-authored-by: Nigel Banks <nigel.g.banks@gmail.com:w>
Co-authored-by: Rosie Le Faive <lefaive@gmail.com>
Co-authored-by: dannylamb <dlamb@islandora.ca>
  • Loading branch information
4 people authored Apr 13, 2022
1 parent d717906 commit fae704f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 45 deletions.
49 changes: 4 additions & 45 deletions demo/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,61 +3,20 @@ ARG repository=local
ARG tag=latest
FROM --platform=$BUILDPLATFORM ${repository}/composer:${tag} AS composer

ARG COMMIT=c4a7574e39ba07e1baa51a0d145da1328e7d9ed1
ARG COMMIT=2d8f79b84c81c9010dfa5f73ec83262bde4313b3

# Islandora based Drupal install.
RUN --mount=type=cache,id=demo-composer,sharing=locked,target=/root/.composer/cache \
--mount=type=cache,id=demo-downloads,sharing=locked,target=/opt/downloads \
# Get the Drupal codebase
git-clone-cached.sh \
--url https://github.com/dannylamb/islandora-sandbox.git \
--url https://github.com/Islandora-Devops/islandora-sandbox.git \
--cache-dir "${DOWNLOAD_CACHE_DIRECTORY}" \
--commit "${COMMIT}" \
--worktree /var/www/drupal && \
cd /var/www/drupal && \
composer install && \
# Set up libraries
mkdir -p /var/www/drupal/web/libraries && \
# PDF.js
PDFJS_VERSION="2.0.943" && \
PDFJS_FILE="pdfjs-${PDFJS_VERSION}-dist.zip" && \
PDFJS_URL="https://github.com/mozilla/pdf.js/releases/download/v${PDFJS_VERSION}/${PDFJS_FILE}" && \
PDFJS_SHA256="381683b05f494fe28e11185f98a238b34a663b1b41b5432aa769ca493e5cd087" && \
download.sh --url "${PDFJS_URL}" --sha256 "${PDFJS_SHA256}" "${DOWNLOAD_CACHE_DIRECTORY}" && \
mkdir -p /var/www/drupal/web/libraries/pdf.js && \
unzip "${DOWNLOAD_CACHE_DIRECTORY}/${PDFJS_FILE}" -d /var/www/drupal/web/libraries/pdf.js && \
# Views Slideshow Dependencies
## jquery.cycle
JQUERY_CYCLE_FILE="jquery.cycle.all.js" && \
JQUERY_CYCLE_URL="https://raw.githubusercontent.com/malsup/cycle/db79722719a8a5a8b93fb5d5970d7296ff6bd8bc/${JQUERY_CYCLE_FILE}" && \
JQUERY_CYCLE_SHA256="58b44d975e1e1f0664d0fb8ab5b2918d08e9497324a021aa93de5894cdb586d4" && \
mkdir -p /var/www/drupal/web/libraries/jquery.cycle && \
download.sh --url "${JQUERY_CYCLE_URL}" --sha256 "${JQUERY_CYCLE_SHA256}" /var/www/drupal/web/libraries/jquery.cycle && \
## jquery.hoverIntent
JQUERY_HOVER_INTENT_FILE="jquery.hoverIntent.js" && \
JQUERY_HOVER_INTENT_URL="https://raw.githubusercontent.com/briancherne/jquery-hoverIntent/60f430c1391ceba429e6a856955a9dbab1d6036d/${JQUERY_HOVER_INTENT_FILE}" && \
JQUERY_HOVER_INTENT_SHA256="65f5f7e1298fe71f10290f4068df30b38a5df0106d6feb63210ddabcc67c3e59" && \
download.sh --url "${JQUERY_HOVER_INTENT_URL}" --sha256 "${JQUERY_HOVER_INTENT_SHA256}" "${DOWNLOAD_CACHE_DIRECTORY}" && \
mkdir -p /var/www/drupal/web/libraries/jquery.hoverIntent && \
cp "${DOWNLOAD_CACHE_DIRECTORY}/${JQUERY_HOVER_INTENT_FILE}" /var/www/drupal/web/libraries/jquery.hoverIntent && \
## jquery.pause
JQUERY_PAUSE_FILE="jquery.pause.js" && \
JQUERY_PAUSE_URL="https://raw.githubusercontent.com/tobia/Pause/bd9c80f16695cbbd5eb9feec87adce19183aaa74/${JQUERY_PAUSE_FILE}" && \
JQUERY_PAUSE_SHA256="39505a2a9fe36fce5b987f6804723d323ac86d0ed7220a5c12094f1d698fce33" && \
download.sh --url "${JQUERY_PAUSE_URL}" --sha256 "${JQUERY_PAUSE_SHA256}" "${DOWNLOAD_CACHE_DIRECTORY}" && \
mkdir -p /var/www/drupal/web/libraries/jquery.pause && \
cp "${DOWNLOAD_CACHE_DIRECTORY}/${JQUERY_PAUSE_FILE}" /var/www/drupal/web/libraries/jquery.pause && \
## json2
JSON2_FILE="jquery.pause.js" && \
JSON2_URL="https://raw.githubusercontent.com/tobia/Pause/bd9c80f16695cbbd5eb9feec87adce19183aaa74/${JSON2_FILE}" && \
JSON2_SHA256="39505a2a9fe36fce5b987f6804723d323ac86d0ed7220a5c12094f1d698fce33" && \
download.sh --url "${JSON2_URL}" --sha256 "${JSON2_SHA256}" "${DOWNLOAD_CACHE_DIRECTORY}" && \
mkdir -p /var/www/drupal/web/libraries/json2 && \
cp "${DOWNLOAD_CACHE_DIRECTORY}/${JSON2_FILE}" /var/www/drupal/web/libraries/json2 && \
# Openseadragon
mkdir -p /var/www/drupal/web/sites/default/files/library-definitions && \
cp /var/www/drupal/web/modules/contrib/openseadragon/openseadragon.json /var/www/drupal/web/sites/default/files/library-definitions
composer install

FROM ${repository}/drupal:${tag} AS drupal
FROM ${repository}/drupal:${tag}

COPY --from=composer --chown=nginx:nginx /var/www /var/www
25 changes: 25 additions & 0 deletions drupal/rootfs/etc/islandora/utilities.sh
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,21 @@ function install_site {
chmod a=rwx "${site_directory}/settings.php"
fi

echo "--driver ${driver}"
echo "--host ${host}"
echo "--port ${port}"
echo "--dbuser ${user}"
echo "--dbname ${db_name}"
echo "PROFILE: ${profile}"
echo "--account-mail=${account_email}"
echo "--account-name=${account_name}"
echo "--site-mail=${site_email}"
echo "--locale=${site_locale}"
echo "--site-name=${site_name}"
echo "--sites-subdir=${subdir}"
echo "USE_EXISTIG_CONFIG: ${use_existing_config_arg}"
echo "EVERYTHING ELSE: ${@}"

/usr/local/bin/install-drupal-site.sh \
--driver "${driver}" \
--host "${host}" \
Expand Down Expand Up @@ -352,6 +367,16 @@ function update_settings_php {
# Allow modifications to settings.php
local previous_owner_group=$(allow_settings_modifications ${site})

if ! grep -q 'global \$content_directories;' ${site_directory}/settings.php; then
echo 'global $content_directories;' >> ${site_directory}/settings.php
echo '$content_directories["sync"] = "/var/www/drupal/content/sync";' >> ${site_directory}/settings.php
fi

if ! grep -q 'global \$content_directories;' ${site_directory}/settings.php; then
echo 'global $content_directories;' >> ${site_directory}/settings.php
echo '$content_directories["sync"] = "/var/www/drupal/content/sync";' >> ${site_directory}/settings.php
fi

drush -l "${site_url}" islandora:settings:create-settings-if-missing
drush -l "${site_url}" islandora:settings:set-hash-salt "${salt}"
drush -l "${site_url}" islandora:settings:set-flystem-fedora-url "${fedora_url}"
Expand Down

2 comments on commit fae704f

@rbos
Copy link

@rbos rbos commented on fae704f May 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at lines 370-379 in utilities.sh. You have two repeated sections that look identical. Intended?

@nigelgbanks
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rbos It's not intentional that being said it shouldn't cause a negative effect.

Please sign in to comment.