Skip to content

Commit

Permalink
Merge pull request #362 from jhu-idc/tm--restore-title-patches
Browse files Browse the repository at this point in the history
TM  restore drupal/title_length patches, etc
  • Loading branch information
springstim committed Dec 21, 2022
2 parents 96380b3 + 19b04b5 commit 389cbe6
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 34 deletions.
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ COPY --chown=nginx:www-data codebase /var/www/drupal/
COPY --chown=0:0 rootfs /
RUN \
/bin/rm -f /etc/cont-init.d/99-custom-setup.sh && \
for dirname in web/sites/default/files/tmp /tmp/private ; do \
/bin/mkdir -m 0775 -p "$dirname" && \
/bin/chown -R nginx:www-data "$dirname" ; done && \
for dirname in /var/www/drupal/{vendor,web} ; do \
if [ -d "$dirname" ] ; then \
find "$dirname" \! -user nginx -exec chown -v nginx:www-data {} \; ; \
fi ; \
done && \
fi ; done && \
chmod 0750 /var/www/drupal/fix_permissions.sh && \
/var/www/drupal/fix_permissions.sh /var/www/drupal/web nginx

Expand Down
13 changes: 11 additions & 2 deletions codebase/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
"type": "composer",
"url": "https://packages.drupal.org/8"
},
{
"type": "vcs",
"url": "https://git.drupal.org/project/title_length.git"
},
{
"type": "vcs",
"url": "[email protected]:Islandora/islandora.git"
Expand Down Expand Up @@ -151,7 +155,7 @@
"drupal/s3fs": "^3.0@alpha",
"drupal/search_api_solr": "^4.1",
"drupal/simplesamlphp_auth": "^3.2",
"drupal/title_length": "^1.1",
"drupal/title_length": "1.1.0",
"drupal/transliterate_filenames": "^1.3",
"drupal/views_data_export": "^1.0",
"drupal/workbench": "^1.3",
Expand Down Expand Up @@ -199,7 +203,8 @@
"drupal/core-project-message": true,
"drupal/core-vendor-hardening": true,
"zaporylie/composer-drupal-optimizations": true,
"wikimedia/composer-merge-plugin": true
"wikimedia/composer-merge-plugin": true,
"dealerdirect/phpcodesniffer-composer-installer": false
}
},
"autoload": {
Expand Down Expand Up @@ -265,6 +270,10 @@
"Media Source Serivce": "patches/mediasourceservice.patch",
"Media Source Controller": "patches/mediasourcecontroller.patch"
},
"drupal/title_length": {
"Node title length 1: Apply user config override": "patches/node_title_length_fix-hook-install.patch",
"Node title length 2: Taxonomy name length": "patches/node_title_length_termNameCharLength-3041979-8.patch"
},
"drupal/search_api_solr": {
"search_api_solr_defaults_post_update_uninstall_module": "patches/search_api_solr_defaults_post_update_uninstall_module.patch"
}
Expand Down
40 changes: 20 additions & 20 deletions codebase/composer.lock

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

4 changes: 2 additions & 2 deletions idc.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ bootstrap: snapshot-empty default destroy-state up install \
# Rebuilds the Drupal cache
.PHONY: cache-rebuild
.SILENT: cache-rebuild
cache-rebuild: set-tmp
cache-rebuild:
echo "rebuilding Drupal cache..."
docker-compose exec -T drupal drush cr -y

Expand Down Expand Up @@ -200,7 +200,7 @@ static-drupal-image:
EXISTING=`docker images -q $$IMAGE` ; \
if test -z "$$EXISTING" ; then \
echo "Building Drupal image with base: $${REPOSITORY}/drupal:$${TAG} " ; \
docker build --build-arg REPOSITORY=$${REPOSITORY} --build-arg TAG=$${TAG} -t $${IMAGE} .; \
docker build --build-arg REPOSITORY=$${REPOSITORY} --build-arg TAG=$${TAG} -t $${IMAGE} . && \
docker tag $${IMAGE} ${REPOSITORY}/drupal-static:static ; \
else \
echo "Using existing Drupal image $${EXISTING}" ; \
Expand Down
Binary file removed rootfs/etc/cont-init.d/.999-startup.sh.swp
Binary file not shown.
18 changes: 17 additions & 1 deletion rootfs/etc/cont-init.d/991-custom-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,23 @@ function main {
local db_count=0
$(installed_local) || db_count=$?

# IDC: Removed composer install (should be done during image build phase)
# IDC: modified composer install section to avoid running composer install as part of startup
# Install Composer modules if necessary.
if [ ! -d vendor ] ; then
printf "\nNo $(pwd)/vendor directory found\n"
if [ ! -f composer.lock ] ; then
printf "\nNo $(pwd)/composer.lock found. Exiting startup script; cannot continue (but not error state).\n"
exit 0
fi

# No vendor/ but we do have composer.lock file:
if [ -n "${DRUPAL_INSTANCE}" ] && [ "${DRUPAL_INSTANCE}" != "dev" ] ;
then
COMPOSER_MEMORY_LIMIT=-1 composer install
else
COMPOSER_MEMORY_LIMIT=-1 composer install --prefer-install=auto
fi
fi

if [ -z "${db_count}" ] || [ "${db_count}" -lt 1 ] ; then
printf "\n\nERROR: Drupal is not installed, no pre-existing state found\n\n"
Expand Down
7 changes: 0 additions & 7 deletions rootfs/etc/cont-init.d/999-startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ MKDIR="/bin/mkdir"

set +e

echo "Creating tmp and private directories"
for d in $DRUPAL_DIR/web/sites/default/files/tmp /tmp/private ; do
echo " directory: '$d'"
$MKDIR -m 0775 -p "$d"
$CHOWN -R nginx:nginx "$d"
done

drush -y state:set system.maintenance_mode 1 --input-format=integer

# This is a workaround for a bug.
Expand Down

0 comments on commit 389cbe6

Please sign in to comment.