Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev to main #708

Merged
merged 18 commits into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,22 @@
COMPOSE_PROJECT_NAME=helfi-kymp
PROJECT_NAME=liikenne

# Default Docker compose profiles
COMPOSE_PROFILES=search,queue

# OpenShift project name
OC_PROJECT_NAME=hki-kanslia-liikenne-test

# Local hostname
DRUPAL_HOSTNAME=helfi-kymp.docker.so

STAGE_FILE_PROXY_ORIGIN="https://helfiliikenne.blob.core.windows.net"
STAGE_FILE_PROXY_ORIGIN=
STAGE_FILE_PROXY_ORIGIN_DIR=

SITE_PREFIX="/kaupunkiymparisto-ja-liikenne"

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

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

# Public webroot
DRUPAL_WEBROOT=public

DRUPAL_SYNC_FILES=no

ELASTIC_PROXY_URL=https://elastic-helfi-kymp.docker.so
63 changes: 0 additions & 63 deletions .github/workflows/robo.yml.dist

This file was deleted.

13 changes: 6 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ 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.2-alpine
options: --hostname app

services:
db:
Expand All @@ -31,7 +33,7 @@ jobs:
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 @@ -53,16 +55,13 @@ jobs:

- 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

29 changes: 12 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,33 @@
# City of Helsinki - KYMP Drupal 9
# City of Helsinki - Liikenne Drupal

## Environments

Env | Branch | Drush alias | URL
--- | ------ | ----------- | ---
development | * | - | http://helfi-kymp.docker.so/
production | main | @main | TBD
Env | Branch | URL
--- |--------| ---
local | dev | http://helfi-kymp.docker.so/
production | main | TBD

## Requirements

You need to have these applications installed to operate on all environments:

- [Docker](https://github.com/druidfi/guidelines/blob/master/docs/docker.md)
- [Stonehenge](https://github.com/druidfi/stonehenge)
- For the new person: Your SSH public key needs to be added to servers

## Create and start the environment

For the first time (new project):
To install Drupal from scratch using existing configuration:

``
$ make new
``

And following times to create and start the environment:
To sync database from testing environment:

``
$ make fresh
``

NOTE: Change these according of the state of your project.

## Login to Drupal container

This will log you inside the app container:
Expand All @@ -39,12 +36,10 @@ This will log you inside the app container:
$ make shell
```

## Testing

Start your containers with `COMPOSE_PROFILES=testing make up` or add
## Docker compose profiles

```
COMPOSE_PROFILES=testing
```
Modify the value of `COMPOSE_PROFILES` environment variable from `.env` file or start the project with `COMPOSE_RROFILES=your-profiles make up`.

to your `.env` file and restart all containers (`make stop && make up`).
### Available profiles:
- `search`
- `queue`
6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"drupal/coder": "^8.3",
"drupal/core-dev": "^9.1",
"phpspec/prophecy-phpunit": "^2",
"phpunit/phpunit": "^9.6"
"phpunit/phpunit": "^9.6",
"weitzman/drupal-test-traits": "^2.1"
},
"conflict": {
"drupal/drupal": "*"
Expand All @@ -47,6 +48,9 @@
"cweagans/composer-patches": true,
"drupal/core-composer-scaffold": true,
"php-http/discovery": false
},
"audit": {
"abandoned": "report"
}
},
"extra": {
Expand Down
Loading