Skip to content

Commit 389cbe6

Browse files
authored
Merge pull request #362 from jhu-idc/tm--restore-title-patches
TM restore drupal/title_length patches, etc
2 parents 96380b3 + 19b04b5 commit 389cbe6

File tree

7 files changed

+54
-34
lines changed

7 files changed

+54
-34
lines changed

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ COPY --chown=nginx:www-data codebase /var/www/drupal/
2222
COPY --chown=0:0 rootfs /
2323
RUN \
2424
/bin/rm -f /etc/cont-init.d/99-custom-setup.sh && \
25+
for dirname in web/sites/default/files/tmp /tmp/private ; do \
26+
/bin/mkdir -m 0775 -p "$dirname" && \
27+
/bin/chown -R nginx:www-data "$dirname" ; done && \
2528
for dirname in /var/www/drupal/{vendor,web} ; do \
2629
if [ -d "$dirname" ] ; then \
2730
find "$dirname" \! -user nginx -exec chown -v nginx:www-data {} \; ; \
28-
fi ; \
29-
done && \
31+
fi ; done && \
3032
chmod 0750 /var/www/drupal/fix_permissions.sh && \
3133
/var/www/drupal/fix_permissions.sh /var/www/drupal/web nginx
3234

codebase/composer.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
"type": "composer",
1616
"url": "https://packages.drupal.org/8"
1717
},
18+
{
19+
"type": "vcs",
20+
"url": "https://git.drupal.org/project/title_length.git"
21+
},
1822
{
1923
"type": "vcs",
2024
"url": "git@github.com:Islandora/islandora.git"
@@ -151,7 +155,7 @@
151155
"drupal/s3fs": "^3.0@alpha",
152156
"drupal/search_api_solr": "^4.1",
153157
"drupal/simplesamlphp_auth": "^3.2",
154-
"drupal/title_length": "^1.1",
158+
"drupal/title_length": "1.1.0",
155159
"drupal/transliterate_filenames": "^1.3",
156160
"drupal/views_data_export": "^1.0",
157161
"drupal/workbench": "^1.3",
@@ -199,7 +203,8 @@
199203
"drupal/core-project-message": true,
200204
"drupal/core-vendor-hardening": true,
201205
"zaporylie/composer-drupal-optimizations": true,
202-
"wikimedia/composer-merge-plugin": true
206+
"wikimedia/composer-merge-plugin": true,
207+
"dealerdirect/phpcodesniffer-composer-installer": false
203208
}
204209
},
205210
"autoload": {
@@ -265,6 +270,10 @@
265270
"Media Source Serivce": "patches/mediasourceservice.patch",
266271
"Media Source Controller": "patches/mediasourcecontroller.patch"
267272
},
273+
"drupal/title_length": {
274+
"Node title length 1: Apply user config override": "patches/node_title_length_fix-hook-install.patch",
275+
"Node title length 2: Taxonomy name length": "patches/node_title_length_termNameCharLength-3041979-8.patch"
276+
},
268277
"drupal/search_api_solr": {
269278
"search_api_solr_defaults_post_update_uninstall_module": "patches/search_api_solr_defaults_post_update_uninstall_module.patch"
270279
}

codebase/composer.lock

Lines changed: 20 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

idc.Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ bootstrap: snapshot-empty default destroy-state up install \
1818
# Rebuilds the Drupal cache
1919
.PHONY: cache-rebuild
2020
.SILENT: cache-rebuild
21-
cache-rebuild: set-tmp
21+
cache-rebuild:
2222
echo "rebuilding Drupal cache..."
2323
docker-compose exec -T drupal drush cr -y
2424

@@ -200,7 +200,7 @@ static-drupal-image:
200200
EXISTING=`docker images -q $$IMAGE` ; \
201201
if test -z "$$EXISTING" ; then \
202202
echo "Building Drupal image with base: $${REPOSITORY}/drupal:$${TAG} " ; \
203-
docker build --build-arg REPOSITORY=$${REPOSITORY} --build-arg TAG=$${TAG} -t $${IMAGE} .; \
203+
docker build --build-arg REPOSITORY=$${REPOSITORY} --build-arg TAG=$${TAG} -t $${IMAGE} . && \
204204
docker tag $${IMAGE} ${REPOSITORY}/drupal-static:static ; \
205205
else \
206206
echo "Using existing Drupal image $${EXISTING}" ; \
-12 KB
Binary file not shown.

rootfs/etc/cont-init.d/991-custom-setup.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,23 @@ function main {
134134
local db_count=0
135135
$(installed_local) || db_count=$?
136136

137-
# IDC: Removed composer install (should be done during image build phase)
137+
# IDC: modified composer install section to avoid running composer install as part of startup
138+
# Install Composer modules if necessary.
139+
if [ ! -d vendor ] ; then
140+
printf "\nNo $(pwd)/vendor directory found\n"
141+
if [ ! -f composer.lock ] ; then
142+
printf "\nNo $(pwd)/composer.lock found. Exiting startup script; cannot continue (but not error state).\n"
143+
exit 0
144+
fi
145+
146+
# No vendor/ but we do have composer.lock file:
147+
if [ -n "${DRUPAL_INSTANCE}" ] && [ "${DRUPAL_INSTANCE}" != "dev" ] ;
148+
then
149+
COMPOSER_MEMORY_LIMIT=-1 composer install
150+
else
151+
COMPOSER_MEMORY_LIMIT=-1 composer install --prefer-install=auto
152+
fi
153+
fi
138154

139155
if [ -z "${db_count}" ] || [ "${db_count}" -lt 1 ] ; then
140156
printf "\n\nERROR: Drupal is not installed, no pre-existing state found\n\n"

rootfs/etc/cont-init.d/999-startup.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@ MKDIR="/bin/mkdir"
1414

1515
set +e
1616

17-
echo "Creating tmp and private directories"
18-
for d in $DRUPAL_DIR/web/sites/default/files/tmp /tmp/private ; do
19-
echo " directory: '$d'"
20-
$MKDIR -m 0775 -p "$d"
21-
$CHOWN -R nginx:nginx "$d"
22-
done
23-
2417
drush -y state:set system.maintenance_mode 1 --input-format=integer
2518

2619
# This is a workaround for a bug.

0 commit comments

Comments
 (0)