Skip to content

Commit

Permalink
Merge pull request #612 from City-of-Helsinki/update-configuration
Browse files Browse the repository at this point in the history
Automatic update
  • Loading branch information
tuutti authored Nov 26, 2024
2 parents aec728c + b4afbf7 commit 3dc6f4f
Show file tree
Hide file tree
Showing 8 changed files with 139 additions and 109 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ DRUPAL_HOSTNAME=helfi-rekry.docker.so
# Docker image
DRUPAL_IMAGE=ghcr.io/city-of-helsinki/drupal-web:8.3

COMPOSE_PROFILES=search,queue
COMPOSE_PROFILES=search

# Public webroot
DRUPAL_WEBROOT=public
Expand Down
5 changes: 2 additions & 3 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,12 @@ services:
- search
artemis:
container_name: "${COMPOSE_PROJECT_NAME}-artemis"
image: quay.io/artemiscloud/activemq-artemis-broker
environment:
AMQ_EXTRA_ARGS: "--user admin --password admin"
image: apache/activemq-artemis
depends_on:
- app
networks:
- internal
- stonehenge-network
profiles:
- queue
chromium:
Expand Down
154 changes: 77 additions & 77 deletions composer.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ content:
third_party_settings: { }
simple_sitemap:
weight: 10
region: content
settings: { }
third_party_settings: { }
region: content
status:
type: boolean_checkbox
weight: 12
Expand Down
23 changes: 11 additions & 12 deletions conf/cmi/search_api.index.job_listings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,29 @@ langcode: en
status: true
dependencies:
config:
- field.storage.node.field_original_language
- field.storage.node.field_task_area
- field.storage.taxonomy_term.field_external_id
- field.storage.node.field_employment_type
- field.storage.node.field_employment
- field.storage.taxonomy_term.field_search_id
- field.storage.node.field_employment_type
- field.storage.node.field_job_duration
- field.storage.node.field_publication_starts
- field.storage.node.field_organization_name
- field.storage.node.field_organization
- field.storage.node.field_jobs
- field.storage.node.field_organization
- field.storage.node.field_organization_name
- field.storage.node.field_original_language
- field.storage.node.field_postal_area
- field.storage.node.field_postal_code
- field.storage.node.field_promoted
- field.storage.node.field_publication_starts
- field.storage.node.field_recruitment_id
- field.storage.node.field_recruitment_type
- field.storage.node.field_task_area
- field.storage.taxonomy_term.field_external_id
- field.storage.taxonomy_term.field_search_id
- search_api.server.elastic_rekry
module:
- taxonomy
- node
- scheduler
- search_api
- helfi_react_search
- helfi_rekry_content
- node
- scheduler
- taxonomy
id: job_listings
name: 'Job listings'
description: ''
Expand Down
17 changes: 17 additions & 0 deletions docker/openshift/crons/menu-queue.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

source /init.sh

if [ -z "$AMQ_BROKERS" ]; then
exit 0
fi

if ! is_drupal_module_enabled "helfi_navigation"; then
exit 0
fi

while true
do
# Restart process every 12 hours.
drush stomp:worker helfi_navigation_menu_queue --lease-time 43200
done
11 changes: 11 additions & 0 deletions docker/openshift/crons/revision-queue.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

if [ -z "$AMQ_BROKERS" ]; then
exit 0
fi

while true
do
# Restart process every 12 hours.
drush stomp:worker helfi_api_base_revision --lease-time 43200
done
34 changes: 19 additions & 15 deletions public/sites/default/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,24 +260,18 @@ function drupal_get_env(string|array $variables) : mixed {
$config['helfi_proxy.settings']['session_suffix'] = $session_suffix;
}

if ($robots_header_enabled = getenv('DRUPAL_X_ROBOTS_TAG_HEADER')) {
$config['helfi_proxy.settings']['robots_header_enabled'] = (bool) $robots_header_enabled;
}

$artemis_destination = drupal_get_env([
'ARTEMIS_DESTINATION',
$amq_destination = drupal_get_env([
'PROJECT_NAME',
]);
$amq_brokers = getenv('AMQ_BROKERS');

$artemis_brokers = getenv('ARTEMIS_BROKERS');

if ($artemis_brokers && $artemis_destination) {
if ($amq_brokers && $amq_destination) {
$settings['stomp']['default'] = [
'clientId' => getenv('ARTEMIS_CLIENT_ID') ?: 'artemis',
'login' => getenv('ARTEMIS_LOGIN') ?: NULL,
'passcode' => getenv('ARTEMIS_PASSCODE') ?: NULL,
'destination' => sprintf('/queue/%s', $artemis_destination),
'brokers' => $artemis_brokers,
'clientId' => getenv('AMQ_CLIENT_ID') ?: 'client_ ' . $amq_destination,
'login' => getenv('AMQ_USER') ?: NULL,
'passcode' => getenv('AMQ_PASSWORD') ?: NULL,
'destination' => sprintf('/queue/%s', $amq_destination),
'brokers' => $amq_brokers,
'timeout' => ['read' => 12000],
'heartbeat' => [
'send' => 20000,
Expand All @@ -289,7 +283,17 @@ function drupal_get_env(string|array $variables) : mixed {
],
],
];
$settings['queue_default'] = 'queue.stomp.default';

$queues = [
'helfi_navigation_menu_queue',
'helfi_api_base_revision',
];
foreach ($queues as $queue) {
$settings['queue_service_' . $queue] = 'queue.stomp.default';
}
// You must configure project specific queues manually in 'all.settings.php'
// file.
// @see https://github.com/City-of-Helsinki/drupal-helfi-platform/blob/main/documentation/queue.md
}

$config['filelog.settings']['rotation']['schedule'] = 'never';
Expand Down

0 comments on commit 3dc6f4f

Please sign in to comment.