Skip to content

Commit

Permalink
Merge pull request #997 from City-of-Helsinki/update-configuration
Browse files Browse the repository at this point in the history
Automatic update
  • Loading branch information
khalima authored Dec 12, 2024
2 parents da85116 + 4c8cfc2 commit 2f5ba1e
Show file tree
Hide file tree
Showing 10 changed files with 141 additions and 34 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
build:
runs-on: ubuntu-latest
container:
image: ghcr.io/city-of-helsinki/drupal-php-docker:8.3-alpine
image: ghcr.io/city-of-helsinki/drupal-web:8.3

services:
db:
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ on:
name: CI
env:
SYMFONY_DEPRECATIONS_HELPER: disabled
SIMPLETEST_BASE_URL: http://app:8888
jobs:
tests:
runs-on: ubuntu-latest
container:
image: ghcr.io/city-of-helsinki/drupal-php-docker:8.3-alpine
options: --hostname app
image: ghcr.io/city-of-helsinki/drupal-web:8.3
options: --hostname app --user 1001

services:
db:
Expand All @@ -26,6 +25,13 @@ jobs:
steps:
- uses: actions/checkout@v4

# Actions worker overrides the default entrypoint with "tail -f /dev/null", so
# we have to start services manually.
- name: Start services
env:
WEBROOT: ${{ github.workspace }}/public
run: entrypoint &

- name: Set browsertest output folder
run: |
echo "BROWSERTEST_OUTPUT_DIRECTORY=$GITHUB_WORKSPACE/public/sites/simpletest" >> $GITHUB_ENV
Expand Down Expand Up @@ -69,10 +75,7 @@ jobs:
- name: Start services
run: |
drush runserver $SIMPLETEST_BASE_URL --dns > /dev/null 2>&1 &
# Wait for drush server to start.
for i in {1..5}; do RESPONSE_CODE=$(curl -s -o /dev/null -w "%{http_code}" "$SIMPLETEST_BASE_URL" || true); if [ "$RESPONSE_CODE" -gt "301" ] || [ "$RESPONSE_CODE" -lt "200" ]; then sleep 2; fi; done
for i in {1..5}; do RESPONSE_CODE=$(curl -k -s -o /dev/null -w "%{http_code}" "$SIMPLETEST_BASE_URL" || true); if [ "$RESPONSE_CODE" -gt "301" ] || [ "$RESPONSE_CODE" -lt "200" ]; then sleep 2; fi; done
- name: Run PHPUnit tests
run: |
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/update-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ jobs:
update-config:
runs-on: ubuntu-latest
container:
image: ghcr.io/city-of-helsinki/drupal-php-docker:8.3-alpine
image: ghcr.io/city-of-helsinki/drupal-web:8.3
options: --hostname app --user 1001
services:
db:
image: mysql:8
Expand Down
16 changes: 12 additions & 4 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ services:
depends_on:
- db
environment:
WEBROOT: /app/public
STAGE_FILE_PROXY_ORIGIN: "${STAGE_FILE_PROXY_ORIGIN}"
STAGE_FILE_PROXY_ORIGIN_DIR: "${STAGE_FILE_PROXY_ORIGIN_DIR}"
APP_ENV: "${APP_ENV:-local}"
Expand All @@ -24,7 +25,6 @@ services:
# DOCKERHOST: host.docker.internal
# Use drush server to run functional tests, so we don't have to care about
# permission or SSL issues.
SIMPLETEST_BASE_URL: "http://app:8888"
BROWSERTEST_OUTPUT_BASE_URL: "https://${DRUPAL_HOSTNAME}"
BROWSERTEST_OUTPUT_DIRECTORY: "/app/public/sites/default/files/simpletest"
DRUPAL_VARNISH_HOST: "${COMPOSE_PROJECT_NAME}-varnish"
Expand Down Expand Up @@ -160,13 +160,21 @@ services:
profiles:
- queue
chromium:
# @todo Update this to newer version once minkphp supports Selenium 4.
# @see https://github.com/minkphp/MinkSelenium2Driver/pull/372
image: seleniarm/standalone-chromium:106.0
image: selenium/standalone-chromium
environment:
SE_NODE_OVERRIDE_MAX_SESSIONS: "true"
SE_NODE_MAX_SESSIONS: "16"
SE_START_XVFB: "false"
SE_START_VNC: "false"
SE_SESSION_RETRY_INTERVAL: "1"
SE_SESSION_REQUEST_TIMEOUT: "10"
depends_on:
- app
networks:
- internal
profiles:
- testing

networks:
internal:
external: false
Expand Down
20 changes: 10 additions & 10 deletions composer.lock

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

76 changes: 76 additions & 0 deletions conf/cmi/language/ru/views.view.helfi_redirect.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
label: Переадресация
display:
default:
display_title: Основной
display_options:
title: Переадресация
fields:
redirect_bulk_form:
action_title: 'С выделенным'
redirect_source__path:
label: От
separator: ', '
is_custom:
label: Собственная
separator: ', '
created:
label: Создано
pager:
options:
tags:
next: 'следующая ›'
previous: '‹ предыдущая'
first: '« первая'
last: 'последняя »'
expose:
items_per_page_label: 'Элементов на страницу'
items_per_page_options_all_label: '- Все -'
offset_label: Пропустить
exposed_form:
options:
submit_button: Фильтр
reset_button_label: Сбросить
exposed_sorts_label: 'Сортировать по'
sort_asc_label: 'По возрастанию'
sort_desc_label: 'По убыванию'
empty:
area_text_custom:
content: 'Перенаправлений пока нет.'
filters:
redirect_source__path:
expose:
label: От
redirect_redirect__uri:
expose:
label: Кому
status_code:
expose:
label: 'Код состояния'
group_info:
label: 'Код состояния'
group_items:
1:
title: '300 Множество Выборов'
2:
title: '301 Перемещёно Окончательно'
3:
title: '302 Найдено'
4:
title: '303 Смотреть Другое'
5:
title: '304 Не Изменялось'
6:
title: '305 Использовать Прокси'
7:
title: '300 Multiple Choices'
language:
expose:
label: 'Язык оригинала'
is_custom:
expose:
label: Собственная
page_1:
display_title: Страница
display_options:
menu:
title: Переадресация
6 changes: 3 additions & 3 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<ini name="error_reporting" value="32767"/>
<!-- Do not limit the amount of memory tests take to run. -->
<ini name="memory_limit" value="-1"/>
<env name="MINK_DRIVER_ARGS_WEBDRIVER" value='["chrome", {"browserName":"chrome","chromeOptions":{"w3c": false}}, "http://chromium:4444"]' />
<env name="DTT_MINK_DRIVER_ARGS" value='["chrome", {"chromeOptions":{"w3c": false }}, "http://chromium:4444"]'/>
<env name="MINK_DRIVER_ARGS_WEBDRIVER" value='["chrome", {"browserName":"chrome", "goog:chromeOptions":{"w3c": true, "args":["--no-sandbox", "--ignore-certificate-errors", "--allow-insecure-localhost", "--headless", "--dns-prefetch-disable"]}}, "http://chromium:4444"]' />
<env name="DTT_MINK_DRIVER_ARGS" value='["chrome", {"browserName":"chrome", "goog:chromeOptions":{"w3c": true, "args":["--no-sandbox","--ignore-certificate-errors", "--allow-insecure-localhost", "--headless", "--dns-prefetch-disable"]}}, "http://chromium:4444"]'/>
<env name="DTT_API_OPTIONS" value='{"socketTimeout": 360, "domWaitTimeout": 3600000}' />
<env name="DTT_API_URL" value="http://chromium:9222"/>
<env name="DTT_BASE_URL" value="http://app:8888"/>
<env name="DTT_BASE_URL" value="https://app"/>
</php>
<testsuites>
<testsuite name="unit">
Expand Down
1 change: 0 additions & 1 deletion tools/make/override.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Docker CLI container
CLI_SERVICE=app
CLI_USER=druid
CLI_SHELL=bash
24 changes: 24 additions & 0 deletions tools/make/project/db-sync.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh

set -e

if [ ! -n "$OC_PROJECT_NAME" ]; then
echo "OC_PROJECT_NAME not set."
exit 1;
fi

oc login --token=${1} --server=https://api.arodevtest.hel.fi:6443
oc project ${OC_PROJECT_NAME}

OC_POD_NAME=$(oc get pods -o name | grep drupal-cron | grep -v deploy)

if [ ! -n "$OC_POD_NAME" ]; then
echo "Failed to parse pod name."
exit 1
fi

oc rsh $OC_POD_NAME drush sql:dump --structure-tables-key=common \
--extra-dump="--no-tablespaces --hex-blob" \
--result-file=/tmp/dump.sql

oc rsync $OC_POD_NAME:/tmp/dump.sql /app
10 changes: 3 additions & 7 deletions tools/make/project/install.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,14 @@ OC_LOGIN_TOKEN ?= $(shell bash -c 'read -s -p "You must obtain an API token by v
SYNC_TARGETS := drush-sync-db

ifneq ($(DUMP_SQL_EXISTS),yes)
SYNC_TARGETS := oc-login oc-sync
SYNC_TARGETS := oc-sync
endif

PHONY += oc-login
oc-login:
$(call drush,helfi:oc:login $(OC_LOGIN_TOKEN))

PHONY += oc-sync
oc-sync:
$(call drush,helfi:oc:get-dump)
docker run --env-file .env -it --rm -v .:/app --name helfi-oc ghcr.io/city-of-helsinki/drupal-oc-cli:latest sh -c "chmod +x /app/tools/make/project/db-sync.sh && /app/tools/make/project/db-sync.sh $(OC_LOGIN_TOKEN)"
$(call drush,sql-query --file=${DOCKER_PROJECT_ROOT}/$(DUMP_SQL_FILENAME),SQL dump imported)
$(call drush,helfi:oc:sanitize-database)
$(call drush,sql-query \"UPDATE file_managed SET uri = REPLACE(uri, 'azure://', 'public://');\",Sanitized Azure URIs)
$(call drush,cr)
$(call drush,cim -y)
$(call drush,cr)
Expand Down

0 comments on commit 2f5ba1e

Please sign in to comment.