Skip to content

Commit

Permalink
Merge pull request #319 from City-of-Helsinki/UHF-8284-platform-v3-up…
Browse files Browse the repository at this point in the history
…dates

UHF-8284: Platform V3 updates
  • Loading branch information
juho-lehmonen authored Nov 7, 2023
2 parents b0686ee + 2ea6afd commit 1f0b8ef
Show file tree
Hide file tree
Showing 1,583 changed files with 20,123 additions and 13,847 deletions.
11 changes: 9 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,24 @@ PROJECT_NAME=paatokset
# OpenShift project name
OC_PROJECT_NAME=hki-kanslia-paatokset-test

# Stage file proxy origin url and folder
STAGE_FILE_PROXY_ORIGIN=https://paatokset.hel.fi
STAGE_FILE_PROXY_ORIGIN_DIR=sites/default/files

# Local hostname
DRUPAL_HOSTNAME=helsinki-paatokset.docker.so

# Docker image
DRUPAL_IMAGE=ghcr.io/city-of-helsinki/drupal-web:8.1
DRUPAL_IMAGE=ghcr.io/city-of-helsinki/drupal-web:8.2

# Composer profiles, include Elasticsearch
COMPOSE_PROFILES=search

# Default source @alias where to sync database and files from
DRUPAL_SYNC_SOURCE=main

# Public webroot
DRUPAL_WEBROOT=public

# No prod environment yet, so don't sync files
# Do not sync files
DRUPAL_SYNC_FILES=no
15 changes: 13 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [PP-000](https://helsinkisolutionoffice.atlassian.net/browse/PP-000)
# [UHF-0000](https://helsinkisolutionoffice.atlassian.net/browse/UHF-0000)
<!-- What problem does this solve? -->

## What was done
Expand All @@ -9,7 +9,7 @@
## How to install

* Make sure your instance is up and running on correct branch.
* `git checkout PP-000-insert_correct_branch`
* `git checkout UHF-0000_insert_correct_branch`
* `make fresh`
* Run `make drush-cr`

Expand All @@ -18,3 +18,14 @@

* [ ] Check that this feature works
* [ ] Check that code follows our standards

## Designers review
<!-- One of the checkboxes below needs to be checked like this: `[x]` (or click when not in edit mode) -->

* [ ] This PR does not need designers review
* [ ] This PR has been visually reviewed by a designer (Name of the designer)

## Other PRs
<!-- For example an related PR in another repository -->

* Link to other PR
9 changes: 2 additions & 7 deletions .github/workflows/artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,11 @@ on:
schedule:
- cron: '0 0 * * 0'
name: Build artifacts
env:
DRUPAL_BUILD_FROM_SCRATCH: true
SIMPLETEST_DB: "mysql://drupal:drupal@db:3306/drupal"
SIMPLETEST_BASE_URL: "http://127.0.0.1:8080"
XDEBUG_MODE: off
jobs:
build:
runs-on: ubuntu-latest
container:
image: ghcr.io/city-of-helsinki/drupal-php-docker:8.1-alpine
image: ghcr.io/city-of-helsinki/drupal-php-docker:8.2-alpine

services:
db:
Expand All @@ -33,7 +28,7 @@ jobs:
fetch-depth: 1

- name: Build project
run: composer install
run: composer install --no-interaction

- name: Setup drupal and save database dump
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/auto-release-pr.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
on:
push:
branches:
- develop
- dev
name: Automatic release PR
jobs:
release-pr:
Expand All @@ -14,8 +14,8 @@ jobs:
run: |
gh pr create \
--base main \
--head develop \
--title "Develop to main" \
--body "Develop to main" || true
--head dev \
--title "Dev to main" \
--body "Dev to main" || true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22 changes: 9 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ on:
branches: ['main', 'dev']
name: CI
env:
SIMPLETEST_DB: "mysql://drupal:drupal@db:3306/drupal"
SIMPLETEST_BASE_URL: "http://127.0.0.1:8080"
SYMFONY_DEPRECATIONS_HELPER: disabled
XDEBUG_MODE: off
SIMPLETEST_BASE_URL: http://app:8888
jobs:
tests:
runs-on: ubuntu-latest
container:
image: ghcr.io/city-of-helsinki/drupal-php-docker:8.1-alpine
image: ghcr.io/city-of-helsinki/drupal-php-docker:8.2-alpine
options: --hostname app

services:
db:
Expand All @@ -31,10 +30,10 @@ jobs:
fetch-depth: 1

- name: Build project
run: composer install
run: composer install --no-interaction

- name: Scan security updates
run: drush pm:security
run: composer audit

- name: Check that subtheme is not built with dev mode
run: if grep -q 'sourceMappingURL=' -R public/themes/custom/hdbt_subtheme/dist/css; then exit 1; fi
Expand All @@ -52,20 +51,17 @@ jobs:
- name: Install Drupal
run: |
mysql --user=drupal --password=drupal --database=drupal --host=db --port=3306 -A < latest.sql
drush cr && drush cim -y
drush deploy
- name: Start services
run: |
drush runserver $SIMPLETEST_BASE_URL > /dev/null 2>&1 &
chromedriver --port=4444 > /dev/null 2>&1 &
# Chromium browser is required to run 'functional-javascript' and
# 'existing-site-javascript' tests.
chromium-browser --headless --disable-gpu --no-sandbox --remote-debugging-port=9222 &
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
- name: Run PHPUnit tests
run: |
composer test-php public/modules/custom
[ -d "tests/" ] && composer test-php tests/ || echo "No DTT tests found. Ignoring..."
if [ -d "tests/" ]; then composer test-php tests/; else echo "No DTT tests found. Ignoring..."; fi
12 changes: 4 additions & 8 deletions .github/workflows/update-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@ on:
repository_dispatch:
types: [config_change]
name: Update config
env:
SIMPLETEST_BASE_URL: "http://127.0.0.1:8080"
SIMPLETEST_DB: "mysql://drupal:drupal@db:3306/drupal"
XDEBUG_MODE: off
jobs:
update-config:
runs-on: ubuntu-latest
container:
image: ghcr.io/city-of-helsinki/drupal-php-docker:8.1-alpine
image: ghcr.io/city-of-helsinki/drupal-php-docker:8.2-alpine

services:
db:
Expand All @@ -37,10 +33,10 @@ jobs:
- name: Build project
run: |
composer install
composer install --no-interaction
$(drush sql:connect) < latest.sql
drush cr && drush cim -y
composer update drupal/helfi_* drupal/hdbt* -W
drush cim -y && drush updb -y && drush cr
composer update drupal/helfi_* drupal/hdbt* -W --no-interaction
drush cr && drush updb -y && drush cex -y
# Update platform
drush helfi:tools:update-platform
Expand Down
18 changes: 5 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,26 @@
drush/sites/
drush/Commands/*
node_modules
public/public:/
public/core
public/libraries
public/modules/contrib
public/modules/custom/paatokset_search/assets
public/themes/contrib
public/sites/default/files
vendor

# Ignore files that are only for the current local environment
public/sites/default/local.settings.php
public/sites/default/local.services.yml
.env.local
helfi-test-automation-python/
public/sites/simpletest/

# Ignore the folder created by PhpStorm
.idea/*
public/sites/default/local.settings.php

# Ignore test related files
.phpunit.*
helfi-test-automation-python/
public/sites/simpletest/

# Ignore local database dumps
*.sql
*.env.local

# Ignore OSX generated files
._*
.DS_Store

!*.gitkeep
!*.keepme
.phpunit.*
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
"drupal/big_pipe_sessionless": "^2.0",
"drupal/core": "^9.5",
"drupal/core-composer-scaffold": "^9.1",
"drupal/hdbt": "4.3.4",
"drupal/hdbt_admin": "^1.8.6",
"drupal/hdbt": "^5.0",
"drupal/hdbt_admin": "^2.0",
"drupal/helfi_api_base": "^2.5.3",
"drupal/helfi_drupal_tools": "dev-main",
"drupal/helfi_platform_config": "2.18.7",
"drupal/helfi_platform_config": "^3.0",
"drupal/helfi_tpr": "^2.0.5",
"drupal/helfi_tunnistamo": "^2.0",
"drupal/json_field": "^1.0@RC",
Expand All @@ -25,11 +25,11 @@
"drupal/purge": "^3.0",
"drupal/search_api": "^1.20",
"drupal/varnish_purge": "^2.1",
"drush/drush": "^10.4",
"drush/drush": "^11",
"elasticsearch/elasticsearch": "^7.15",
"josdejong/jsoneditor": "^5.29",
"league/csv": "^9.8",
"paatokset/paatokset_search": "1.0.27"
"paatokset/paatokset_search": "1.0.29"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
Expand Down Expand Up @@ -135,9 +135,9 @@
"type": "package",
"package": {
"name": "paatokset/paatokset_search",
"version": "1.0.27",
"version": "1.0.29",
"dist": {
"url": "https://github.com/City-of-Helsinki/paatokset-search/releases/download/1.0.27/paatokset_search.zip",
"url": "https://github.com/City-of-Helsinki/paatokset-search/releases/download/1.0.29/paatokset_search.zip",
"type": "zip"
}
}
Expand Down
Loading

0 comments on commit 1f0b8ef

Please sign in to comment.