Skip to content
Open
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
25 changes: 21 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
# Enter

We use [DDEV](https://ddev.com/) and [Task](https://taskfile.dev/) for development:
We use [ITK-dev docker setup] or [DDEV](https://ddev.com/) and [Task](https://taskfile.dev/) for development:

``` shell
task site:install
```

Set

``` dotenv
TASK_USE_DDEV=true
```

in `.env.local` to make `task` use `ddev` rather than `docker compose` for running commands.

``` shell
task site:update
ddev launch
task site:open
```

Run `task` to see what cool task are available. Running `ddev` can help with other stuff.
Run `task` to see what cool task are available.

## Adapter

Expand Down Expand Up @@ -51,5 +59,14 @@ Design decisions are recorded in [docs/adr](docs/adr/README.md).
A [Scorpio Broker](https://scorpio.readthedocs.io/) is part of the development setup.

``` shell
ddev exec "curl --silent http://scorpio.local:9090/ngsi-ld/v1/types | jq"
docker compose exec phpfpm curl --silent http://scorpio.local:9090/ngsi-ld/v1/types | jq
```

If you're using the [ITK-dev docker setup], the broker can also be
accessed on <http://scorpio.enter.local.itkdev.dk/>, e.g.

``` php
curl --silent http://scorpio.enter.local.itkdev.dk/ngsi-ld/v1/types | jq
```

[ITK-dev docker setup]: https://github.com/itk-dev/devops_itkdev-docker/
103 changes: 85 additions & 18 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,36 @@ tasks:
desc: Install site from scratch
prompt: Really (re)install site?
cmds:
- ddev delete --omit-snapshot --yes
- rm -fr .ddev/data/scorpio-db/
- if: '[ "$TASK_USE_DDEV" = "true" ]'
cmd: |
ddev delete --omit-snapshot --yes
rm -fr .ddev/data/scorpio-db/
- task: site:update

site:update:
desc: Update site
cmds:
- ddev restart
- ddev composer install
# - ddev console doctrine:migrations:migrate --no-interaction
- ddev console cache:clear
- if: '[ "$TASK_USE_DDEV" != "true" ]'
task: compose
vars:
TASK_ARGS: pull
- if: '[ "$TASK_USE_DDEV" = "true" ]'
cmd: ddev restart
- task: composer:install
# - task: console
# vars:
# TASK_ARGS: doctrine:migrations:migrate --no-interaction
- task: console
vars:
TASK_ARGS: cache:clear

site:open:
desc: Open the site in a browser
cmds:
- if: '[ "$TASK_USE_DDEV" != "true" ]'
cmd: open 'http://enter.local.itkdev.dk/'
- if: '[ "$TASK_USE_DDEV" = "true" ]'
cmd: ddev launch

test:
desc: Run all tests
Expand All @@ -31,14 +50,20 @@ tasks:
env:
APP_ENV: test
desc: 'Run all {{.TASK | replace "test:" "" }} tests'
cmd: ddev php bin/phpunit tests/{{.TASK | replace "test:" "" | title }}
cmd:
task: php
vars:
TASK_ARGS: bin/phpunit tests/{{.TASK | replace "test:" "" | title }}

test:integration: *test_task
test:application: *test_task

import:
desc: 'Import a source into the broker, e.g. task import -- mtm_spatialmaps-handicap-parking'
cmd: ddev console app:import {{.CLI_ARGS}}
desc: 'Import a source into the broker, e.g. `task {{.TASK}} -- mtm_spatialmaps-handicap-parking`'
cmd:
task: console
vars:
TASK_ARGS: app:import

coding-standards:apply:
desc: 'Apply coding standards'
Expand Down Expand Up @@ -114,26 +139,38 @@ tasks:
coding-standards:php:apply:
desc: 'Apply coding standards for PHP'
cmds:
- ddev php vendor/bin/rector
- ddev php vendor/bin/php-cs-fixer fix
- task: php
vars:
TASK_ARGS: vendor/bin/rector
- task: php
vars:
TASK_ARGS: vendor/bin/php-cs-fixer fix

coding-standards:php:check:
desc: 'Apply and check coding standards for PHP'
cmds:
- task: coding-standards:php:apply
- ddev php vendor/bin/rector --dry-run
- ddev php vendor/bin/php-cs-fixer check
- task: php
vars:
TASK_ARGS: vendor/bin/rector --dry-run
- task: php
vars:
TASK_ARGS: vendor/bin/php-cs-fixer check

coding-standards:twig:apply:
desc: 'Apply coding standards for Twig'
cmds:
- ddev php vendor/bin/twig-cs-fixer fix
- task: php
vars:
TASK_ARGS: vendor/bin/twig-cs-fixer fix

coding-standards:twig:check:
desc: 'Apply and check coding standards for Twig'
cmds:
- task: coding-standards:twig:apply
- ddev php vendor/bin/twig-cs-fixer check
- task: php
vars:
TASK_ARGS: vendor/bin/twig-cs-fixer check

coding-standards:yaml:apply:
desc: 'Apply coding standards for YAML'
Expand Down Expand Up @@ -172,9 +209,39 @@ tasks:

composer:
internal: true
task: compose
vars:
TASK_ARGS: run --rm --no-deps phpfpm composer
cmd:
task: compose
vars:
TASK_ARGS: run --rm --no-deps phpfpm composer {{.TASK_ARGS}}

composer:install:
internal: true
cmds:
- if: '[ "$APP_ENV" != "prod" ]'
task: composer
vars:
TASK_ARGS: install
- if: '[ "$APP_ENV" = "prod" ]'
task: composer
vars:
TASK_ARGS: install --no-dev --classmap-authoritative

console:
internal: true
cmd:
task: php
vars:
TASK_ARGS: bin/console {{.TASK_ARGS}}

php:
internal: true
cmds:
- if: '[ "$TASK_USE_DDEV" != "true" ]'
task: compose
vars:
TASK_ARGS: exec phpfpm php {{.TASK_ARGS}}
- if: '[ "$TASK_USE_DDEV" = "true" ]'
cmd: ddev php {{.TASK_ARGS}}

default:
cmds:
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@
},
"require-dev": {
"ergebnis/composer-normalize": "^2.52",
"friendsofphp/php-cs-fixer": "^3.95.24",
"phpstan/phpstan": "^2.2.12",
"phpunit/phpunit": "^13.3",
"rector/rector": "^2.6",
"friendsofphp/php-cs-fixer": "^3.95.25",
"phpstan/phpstan": "^2.2.13",
"phpunit/phpunit": "^13.3.3",
"rector/rector": "^2.6.6",
"symfony/browser-kit": "~8.1.0",
"symfony/css-selector": "~8.1.6",
"symfony/debug-bundle": "~8.1.0",
"symfony/maker-bundle": "^1.67",
"symfony/stopwatch": "~8.1.0",
"symfony/web-profiler-bundle": "~8.1.0",
"vincentlanglet/twig-cs-fixer": "^4.1"
"vincentlanglet/twig-cs-fixer": "^4.1.1"
},
"replace": {
"symfony/polyfill-ctype": "*",
Expand Down
Loading