diff --git a/.platform/schema b/.platform/schema index 3f10ffe7..19c7bdba 100644 --- a/.platform/schema +++ b/.platform/schema @@ -1 +1 @@ -15 \ No newline at end of file +16 \ No newline at end of file diff --git a/composer.lock b/composer.lock index f9543feb..6564d3ca 100644 --- a/composer.lock +++ b/composer.lock @@ -1896,6 +1896,10 @@ "homepage": "https://www.drupal.org/u/matio89", "role": "Maintainer" }, + { + "name": "fethi.krout", + "homepage": "https://www.drupal.org/user/3206765" + }, { "name": "japerry", "homepage": "https://www.drupal.org/user/45640" @@ -3298,17 +3302,17 @@ }, { "name": "drupal/entity_browser", - "version": "2.12.0", + "version": "2.13.0", "source": { "type": "git", "url": "https://git.drupalcode.org/project/entity_browser.git", - "reference": "8.x-2.12" + "reference": "8.x-2.13" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/entity_browser-8.x-2.12.zip", - "reference": "8.x-2.12", - "shasum": "eeafb55f02317c63b17d71913cb918e6341b7c0d" + "url": "https://ftp.drupal.org/files/projects/entity_browser-8.x-2.13.zip", + "reference": "8.x-2.13", + "shasum": "9c31caed2602a5cb582cb4f1e1feaac44cbbc21b" }, "require": { "drupal/core": "^10.2 || ^11" @@ -3317,12 +3321,11 @@ "drupal/media_entity": "1.*" }, "require-dev": { - "drupal/ckeditor": "^1.0", "drupal/embed": "^1.0", "drupal/entity_embed": "^1.0", "drupal/entity_reference_revisions": "^1.0", "drupal/entityqueue": "^1.0", - "drupal/inline_entity_form": "^1.0@rc", + "drupal/inline_entity_form": "^1 || ^3", "drupal/paragraphs": "^1.0", "drupal/search_api": "^1.0", "drupal/token": "^1.0" @@ -3330,8 +3333,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "8.x-2.12", - "datestamp": "1730631838", + "version": "8.x-2.13", + "datestamp": "1739701403", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -3457,17 +3460,17 @@ }, { "name": "drupal/entity_usage", - "version": "2.0.0-beta17", + "version": "2.0.0-beta18", "source": { "type": "git", "url": "https://git.drupalcode.org/project/entity_usage.git", - "reference": "8.x-2.0-beta17" + "reference": "8.x-2.0-beta18" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/entity_usage-8.x-2.0-beta17.zip", - "reference": "8.x-2.0-beta17", - "shasum": "29691274f6b68b13a8d1ba295677453c85c2ed39" + "url": "https://ftp.drupal.org/files/projects/entity_usage-8.x-2.0-beta18.zip", + "reference": "8.x-2.0-beta18", + "shasum": "d7303b5b0384da129580236cc96bb06990eeadef" }, "require": { "drupal/core": "^10.2 || ^11" @@ -3482,13 +3485,14 @@ "drupal/entity_reference_revisions": "~1.0", "drupal/inline_entity_form": "^1.0@RC || ^3.0@RC", "drupal/paragraphs": "~1.0", + "drupal/redirect": "^1.11", "drupal/webform": "^6.0.0-alpha4" }, "type": "drupal-module", "extra": { "drupal": { - "version": "8.x-2.0-beta17", - "datestamp": "1736865887", + "version": "8.x-2.0-beta18", + "datestamp": "1739640732", "security-coverage": { "status": "not-covered", "message": "Beta releases are not covered by Drupal security advisories." @@ -4011,17 +4015,17 @@ }, { "name": "drupal/gin", - "version": "4.0.2", + "version": "4.0.4", "source": { "type": "git", "url": "https://git.drupalcode.org/project/gin.git", - "reference": "4.0.2" + "reference": "4.0.4" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/gin-4.0.2.zip", - "reference": "4.0.2", - "shasum": "501f167bd7009cffa29848a918b3982cb0a8245b" + "url": "https://ftp.drupal.org/files/projects/gin-4.0.4.zip", + "reference": "4.0.4", + "shasum": "de1a6012eb5543ac4fb807e8314e369d64812c62" }, "require": { "drupal/core": "^10 || ^11", @@ -4030,8 +4034,8 @@ "type": "drupal-theme", "extra": { "drupal": { - "version": "4.0.2", - "datestamp": "1735405135", + "version": "4.0.4", + "datestamp": "1739529395", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -4194,16 +4198,16 @@ }, { "name": "drupal/hdbt", - "version": "6.9.16", + "version": "6.9.23", "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-hdbt.git", - "reference": "b30f5a708ee6a9fbf5b777683667a35473103fa7" + "reference": "dc0f8d4d37681b0fce961d44ec7387fb3d582893" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-hdbt/zipball/b30f5a708ee6a9fbf5b777683667a35473103fa7", - "reference": "b30f5a708ee6a9fbf5b777683667a35473103fa7", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-hdbt/zipball/dc0f8d4d37681b0fce961d44ec7387fb3d582893", + "reference": "dc0f8d4d37681b0fce961d44ec7387fb3d582893", "shasum": "" }, "require": { @@ -4222,10 +4226,10 @@ "Drupal" ], "support": { - "source": "https://github.com/City-of-Helsinki/drupal-hdbt/tree/6.9.16", + "source": "https://github.com/City-of-Helsinki/drupal-hdbt/tree/6.9.23", "issues": "https://github.com/City-of-Helsinki/drupal-hdbt/issues" }, - "time": "2025-02-11T07:11:26+00:00" + "time": "2025-02-18T05:39:06+00:00" }, { "name": "drupal/hdbt_admin", @@ -4413,12 +4417,12 @@ "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-tools.git", - "reference": "bc5416375195d1307adf188098d75a19a5de0224" + "reference": "cdb4837a98b7f30f2db719e03f45507abfedbe3b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-tools/zipball/bc5416375195d1307adf188098d75a19a5de0224", - "reference": "bc5416375195d1307adf188098d75a19a5de0224", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-tools/zipball/cdb4837a98b7f30f2db719e03f45507abfedbe3b", + "reference": "cdb4837a98b7f30f2db719e03f45507abfedbe3b", "shasum": "" }, "require": { @@ -4493,7 +4497,7 @@ "source": "https://github.com/City-of-Helsinki/drupal-tools/tree/main", "issues": "https://github.com/City-of-Helsinki/drupal-tools/issues" }, - "time": "2025-01-15T12:24:04+00:00" + "time": "2025-02-14T10:49:04+00:00" }, { "name": "drupal/helfi_navigation", @@ -4531,16 +4535,16 @@ }, { "name": "drupal/helfi_platform_config", - "version": "4.12.16", + "version": "4.12.19", "source": { "type": "git", "url": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config.git", - "reference": "f903111158324d608b3d60f837472934d3d93f2d" + "reference": "6f07f3063f1d65d40f63d3e0c04e9ec7bdbfaf9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/City-of-Helsinki/drupal-helfi-platform-config/zipball/f903111158324d608b3d60f837472934d3d93f2d", - "reference": "f903111158324d608b3d60f837472934d3d93f2d", + "url": "https://api.github.com/repos/City-of-Helsinki/drupal-helfi-platform-config/zipball/6f07f3063f1d65d40f63d3e0c04e9ec7bdbfaf9c", + "reference": "6f07f3063f1d65d40f63d3e0c04e9ec7bdbfaf9c", "shasum": "" }, "require": { @@ -4664,10 +4668,10 @@ ], "description": "HELfi platform config", "support": { - "source": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config/tree/4.12.16", + "source": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config/tree/4.12.19", "issues": "https://github.com/City-of-Helsinki/drupal-helfi-platform-config/issues" }, - "time": "2025-02-10T15:16:22+00:00" + "time": "2025-02-17T10:50:28+00:00" }, { "name": "drupal/helfi_proxy", @@ -5727,20 +5731,20 @@ }, { "name": "drupal/openid_connect", - "version": "3.0.0-alpha5", + "version": "3.0.0-alpha6", "source": { "type": "git", "url": "https://git.drupalcode.org/project/openid_connect.git", - "reference": "3.0.0-alpha5" + "reference": "3.0.0-alpha6" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/openid_connect-3.0.0-alpha5.zip", - "reference": "3.0.0-alpha5", - "shasum": "6bca4f7ac0f675370008a0631095722347379b04" + "url": "https://ftp.drupal.org/files/projects/openid_connect-3.0.0-alpha6.zip", + "reference": "3.0.0-alpha6", + "shasum": "ae9b7a24d8ad2534756e5b2689fad6688e6b3cb0" }, "require": { - "drupal/core": "^9.5 || ^10.2 || ^11", + "drupal/core": "^10.2 || ^11", "drupal/externalauth": "^2.0", "ext-json": "*", "php": ">=8.1.0" @@ -5748,8 +5752,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "3.0.0-alpha5", - "datestamp": "1735590945", + "version": "3.0.0-alpha6", + "datestamp": "1739445531", "security-coverage": { "status": "not-covered", "message": "Alpha releases are not covered by Drupal security advisories." @@ -5977,7 +5981,7 @@ "extra": { "drupal": { "version": "8.x-1.13", - "datestamp": "1722507672", + "datestamp": "1739552840", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -7464,12 +7468,20 @@ "shasum": "9fbddb71417113d58345d2fbe9d0a1aa9c5d5c36" }, "require": { - "drupal/core": "^8 || ^9 || ^10" + "drupal/core": "^8 || ^9 || ^10", + "drupal/purge": "~3.0" }, "require-dev": { - "drupal/purge": "*", + "behat/mink-extension": "v2.2", + "behat/mink-selenium2-driver": "1.3.x-dev", + "bex/behat-screenshot": "dev-master", + "drupal/coder": "^8.3", + "drupal/drupal-extension": "master-dev", + "drupal/purge": "dev-3.x", "drupal/purge_tokens": "*", - "drupal/varnish_purger-varnish_purger": "*" + "drupal/varnish_purger-varnish_purger": "*", + "phpmd/phpmd": "dev-master", + "phpmetrics/phpmetrics": "dev-master" }, "type": "drupal-module", "extra": { @@ -7484,13 +7496,17 @@ }, "notification-url": "https://packages.drupal.org/8/downloads", "license": [ - "GPL-2.0-or-later" + "GPL-2.0+" ], "authors": [ { "name": "deadbeef", "homepage": "https://www.drupal.org/user/93644" }, + { + "name": "dieterholvoet", + "homepage": "https://www.drupal.org/user/3567222" + }, { "name": "javivf", "homepage": "https://www.drupal.org/user/2789335" @@ -7500,10 +7516,11 @@ "homepage": "https://www.drupal.org/user/2479724" }, { - "name": "MiSc", + "name": "misc", "homepage": "https://www.drupal.org/user/382892" } ], + "description": "Provides a purger for Varnish for Purger module.", "homepage": "https://www.drupal.org/project/varnish_purge", "support": { "source": "https://git.drupalcode.org/project/varnish_purge" @@ -7635,17 +7652,17 @@ }, { "name": "drupal/views_bulk_operations", - "version": "4.3.2", + "version": "4.3.3", "source": { "type": "git", "url": "https://git.drupalcode.org/project/views_bulk_operations.git", - "reference": "4.3.2" + "reference": "4.3.3" }, "dist": { "type": "zip", - "url": "https://ftp.drupal.org/files/projects/views_bulk_operations-4.3.2.zip", - "reference": "4.3.2", - "shasum": "b3d0ee06abb15520595b83324e93c5500d5dcef3" + "url": "https://ftp.drupal.org/files/projects/views_bulk_operations-4.3.3.zip", + "reference": "4.3.3", + "shasum": "60d83a18ef31fd1e85fb30137fd03a55cad275f3" }, "require": { "drupal/core": "^10.3 || ^11" @@ -7662,8 +7679,8 @@ "type": "drupal-module", "extra": { "drupal": { - "version": "4.3.2", - "datestamp": "1731070018", + "version": "4.3.3", + "datestamp": "1739278730", "security-coverage": { "status": "covered", "message": "Covered by Drupal's security advisory policy" @@ -7691,9 +7708,9 @@ "description": "Adds an ability to perform bulk operations on selected entities from view results. Provides an API to create such operations.", "homepage": "https://www.drupal.org/project/views_bulk_operations", "support": { - "source": "https://git.drupalcode.org/project/views_bulk_operations/-/tree/8.x-3.x", - "issues": "https://www.drupal.org/project/issues/views_bulk_operations?version=8.x", - "docs": "https://www.drupal.org/docs/8/modules/views-bulk-operations-vbo" + "source": "https://git.drupalcode.org/project/views_bulk_operations", + "issues": "https://www.drupal.org/project/issues/views_bulk_operations?version=any_4.", + "docs": "https://www.drupal.org/docs/contributed-modules/views-bulk-operations-vbo" } }, { @@ -14596,24 +14613,23 @@ }, { "name": "twig/twig", - "version": "v3.19.0", + "version": "v3.20.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "d4f8c2b86374f08efc859323dbcd95c590f7124e" + "reference": "3468920399451a384bef53cf7996965f7cd40183" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/d4f8c2b86374f08efc859323dbcd95c590f7124e", - "reference": "d4f8c2b86374f08efc859323dbcd95c590f7124e", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/3468920399451a384bef53cf7996965f7cd40183", + "reference": "3468920399451a384bef53cf7996965f7cd40183", "shasum": "" }, "require": { - "php": ">=8.0.2", + "php": ">=8.1.0", "symfony/deprecation-contracts": "^2.5|^3", "symfony/polyfill-ctype": "^1.8", - "symfony/polyfill-mbstring": "^1.3", - "symfony/polyfill-php81": "^1.29" + "symfony/polyfill-mbstring": "^1.3" }, "require-dev": { "phpstan/phpstan": "^2.0", @@ -14660,7 +14676,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.19.0" + "source": "https://github.com/twigphp/Twig/tree/v3.20.0" }, "funding": [ { @@ -14672,7 +14688,7 @@ "type": "tidelift" } ], - "time": "2025-01-29T07:06:14+00:00" + "time": "2025-02-13T08:34:43+00:00" }, { "name": "twistor/flysystem-stream-wrapper", diff --git a/conf/cmi/core.entity_view_display.helfi_news.helfi_news.default.yml b/conf/cmi/core.entity_view_display.helfi_news.helfi_news.default.yml index 8cd075e1..b48bdb99 100644 --- a/conf/cmi/core.entity_view_display.helfi_news.helfi_news.default.yml +++ b/conf/cmi/core.entity_view_display.helfi_news.helfi_news.default.yml @@ -27,6 +27,7 @@ hidden: neighbourhoods_uuid: true node_url: true published_at: true + search_api_excerpt: true short_title: true tags: true tags_uuid: true diff --git a/conf/cmi/core.entity_view_display.helfi_news.helfi_news.medium_teaser.yml b/conf/cmi/core.entity_view_display.helfi_news.helfi_news.medium_teaser.yml index 6582ebe9..a24d2f6f 100644 --- a/conf/cmi/core.entity_view_display.helfi_news.helfi_news.medium_teaser.yml +++ b/conf/cmi/core.entity_view_display.helfi_news.helfi_news.medium_teaser.yml @@ -27,6 +27,7 @@ hidden: neighbourhoods_uuid: true node_url: true published_at: true + search_api_excerpt: true short_title: true tags: true tags_uuid: true diff --git a/docker/openshift/Dockerfile b/docker/openshift/Dockerfile index 32d4a3a2..401de35e 100644 --- a/docker/openshift/Dockerfile +++ b/docker/openshift/Dockerfile @@ -5,17 +5,15 @@ COPY / /var/www/html/ WORKDIR /var/www/html RUN composer install --no-progress --profile --prefer-dist --no-interaction --no-dev --optimize-autoloader -# Copy ALL deploy scripts +# Copy custom entrypoints. +# @see https://github.com/City-of-Helsinki/drupal-docker-images/tree/main/openshift/drupal +RUN mkdir -p /crons /entrypoints /deploy COPY docker/openshift/entrypoints/ /entrypoints -RUN chmod +x /entrypoints/* +COPY docker/openshift/crons/ /crons +COPY docker/openshift/deploy /deploy +RUN chmod +x /entrypoints/* /deploy/* /crons/* COPY docker/openshift/init.sh / -# Copy cron scripts -RUN mkdir /crons -COPY docker/openshift/crons/ /crons -COPY docker/openshift/cron-entrypoint.sh /usr/local/bin/cron-entrypoint -RUN chmod +x /crons/* /usr/local/bin/cron-entrypoint - # Copy nginx overrides. COPY docker/openshift/custom.locations /etc/nginx/conf.d/custom.locations diff --git a/docker/openshift/cron-entrypoint.sh b/docker/openshift/cron-entrypoint.sh deleted file mode 100644 index b9f55232..00000000 --- a/docker/openshift/cron-entrypoint.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -source /init.sh - -echo "Starting cron: $(date)" - -# You can add any additional cron "daemons" to docker/openshift/crons/ folder. -# -# Example: -# @code -# #!/bin/bash -# while true -# do -# drush some-command -# sleep 600 -# done -# @endcode - -for cron in /crons/*.sh; do - # Skip legacy base.sh script if it exists. - # Skip Kubernetes hooks that are stored in crons directory. - if [[ "${cron##*/}" == "base.sh" ]] || [[ "${cron##*/}" == *-hook.sh ]]; then - continue - elif [[ -r "$cron" ]]; then - echo "Starting $cron" - exec "$cron" & - fi -done - -while true -do - # Rudimentary process supervisor: - # Waits for the next process to terminate. The parent - # process is killed if any subprocess exists with failure. - # OpenShift should then restart the cron pod. - wait -n - exit_code=$? - if [[ "$exit_code" -ne 0 ]]; then - output_error_message "Cron subprocess failed with exit code $exit_code" - exit 1 - fi -done diff --git a/docker/openshift/deploy/10-preflight.sh b/docker/openshift/deploy/10-preflight.sh new file mode 100644 index 00000000..b58e6213 --- /dev/null +++ b/docker/openshift/deploy/10-preflight.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +source /init.sh + +if [ -f "../docker/openshift/preflight/preflight.php" ]; then + echo "Running preflight checks ..." + if ! php ../docker/openshift/preflight/preflight.php; then + exit 1 + fi +fi + diff --git a/docker/openshift/deploy/20-deploy.sh b/docker/openshift/deploy/20-deploy.sh new file mode 100644 index 00000000..bec9b3ad --- /dev/null +++ b/docker/openshift/deploy/20-deploy.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +# Skip deployment script if ENV var is true +if [ "$SKIP_DEPLOY_SCRIPTS" = "true" ]; then + echo "SKIP_DEPLOY_SCRIPTS is true. Skipping the steps." + return +fi + +source /init.sh + +echo "Starting deploy: $(date)" + +# Populate deploy ID so 20-deploy.sh is skipped. +# @todo Remove this once 20-deploy.sh is removed. +set_deploy_id $OPENSHIFT_BUILD_NAME + +drush state:set system.maintenance_mode 1 --input-format=integer +# Run pre-deploy tasks. +# @see https://github.com/City-of-Helsinki/drupal-module-helfi-api-base/blob/main/documentation/deploy-hooks.md +drush helfi:pre-deploy || true +# Run maintenance tasks (config import, database updates etc) +drush deploy +# Run post-deploy tasks. +# @see https://github.com/City-of-Helsinki/drupal-module-helfi-api-base/blob/main/documentation/deploy-hooks.md +drush helfi:post-deploy || true +# Disable maintenance mode +drush state:set system.maintenance_mode 0 --input-format=integer diff --git a/docker/openshift/entrypoints/15-twig-compile.sh b/docker/openshift/entrypoints/15-twig-compile.sh new file mode 100644 index 00000000..c164dbee --- /dev/null +++ b/docker/openshift/entrypoints/15-twig-compile.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +# Populate twig caches. +if [ ! -d "/tmp/twig" ]; then + drush twig:compile || true +fi diff --git a/docker/openshift/entrypoints/20-deploy.sh b/docker/openshift/entrypoints/20-deploy.sh index 4c02d6f1..a983c701 100644 --- a/docker/openshift/entrypoints/20-deploy.sh +++ b/docker/openshift/entrypoints/20-deploy.sh @@ -1,4 +1,5 @@ #!/bin/bash +# NOTE: This script is being phased out in favor of new deployment job pod. # Skip deployment script if ENV var is true if [ "$SKIP_DEPLOY_SCRIPTS" = "true" ]; then