-
Notifications
You must be signed in to change notification settings - Fork 20
/
.lando.yml
126 lines (126 loc) · 6.54 KB
/
.lando.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: az_quickstart
recipe: drupal10
config:
php: '8.3'
via: apache:2.4
webroot: web
database: mariadb:10.6
xdebug: false
services:
# Replaces default lando MariaDB image with arm64 (Apple M1) compatible one.
# TODO: remove database service overrides once lando is updated.
database:
type: compose
services:
image: mariadb:10.6
command: docker-entrypoint.sh mariadbd
restart: always
ports:
- '3306'
environment:
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: 'true'
MARIADB_DATABASE: drupal10
MYSQL_DATABASE: drupal10
MARIADB_USER: drupal10
MARIADB_PASSWORD: drupal10
appserver:
config:
php: .vscode/php.ini
overrides:
environment:
SIMPLETEST_DB: 'mysql://drupal10:drupal10@database/drupal10'
SIMPLETEST_BASE_URL: 'http://appserver'
MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", {"browserName":"chrome","goog:chromeOptions":{"args":["--disable-gpu","--disable-dev-shm-usage","--headless","--no-sandbox"],"w3c":false}},"http://chromedriver:4444/wd/hub"]'
XDEBUG_MODE: debug
volumes:
# Don't share our host working directory as /app. We want /app empty for composer.
- /app
# Instead share our host working directory as a standalone package.
- .:/usr/local/quickstart-install-profile
build:
# Create a new quickstart project and use the installation profile as a non-packagist repository.
# Use the matching scaffolding branch if available.
- BRANCH_NAME=$(git -C /usr/local/quickstart-install-profile rev-parse --abbrev-ref HEAD); if [ $(git ls-remote --heads https://github.com/az-digital/az-quickstart-scaffolding.git $BRANCH_NAME | wc -l) = 1 ]; then SCAFFOLD_BRANCH="$BRANCH_NAME"; else SCAFFOLD_BRANCH="main"; fi; git clone --branch $SCAFFOLD_BRANCH https://github.com/az-digital/az-quickstart-scaffolding.git /app
- composer config repositories.localdev path /usr/local/quickstart-install-profile && composer require --no-update az-digital/az_quickstart:\*@dev
# Use the matching require-dev metapackage branch if available.
- BRANCH_NAME=$(git -C /usr/local/quickstart-install-profile rev-parse --abbrev-ref HEAD); if [ $(git ls-remote --heads https://github.com/az-digital/az-quickstart-dev.git $BRANCH_NAME | wc -l) = 1 ]; then DEV_PACKAGE_BRANCH="$BRANCH_NAME"; else DEV_PACKAGE_BRANCH=main; fi; composer require --no-update --dev az-digital/az-quickstart-dev:dev-${DEV_PACKAGE_BRANCH}
- composer install
- ln -s /usr/local/quickstart-install-profile/.vscode /app/.vscode
node:
type: node:20
build:
- yarn install
chromedriver:
type: compose
services:
image: seleniarm/standalone-chromium:4.1.4-20220429
command: /opt/bin/entry_point.sh
tooling:
# Provide a command to install Drupal.
# Current versions of the Bitnami MySQL container sometimes signal
# healthy before MySQL is fully started. This can result in MySQL errors
# in a race condition if Drupal is installed during the run phase.
install:
service: appserver
cmd:
- /app/vendor/bin/drush --root=/app/web site:install [email protected] --account-name=azadmin --account-pass=azadmin2024 --db-url=mysql://drupal10:drupal10@database:3306/drupal10 -y --verbose
- /app/vendor/bin/drush --root=/app/web config:set -y az_cas.settings disable_login_form 0
- /app/vendor/bin/drush --root=/app/web cache:rebuild
# Enable theme debugging.
theme-debug:
service: appserver
user: root
cmd:
- echo "theme-debug relied on Drupal console (now deprecated) and is no longer available. Please consult CONTRIBUTING.md for instructions on how to manually turn on Twig debug and other debugging settings."
# Provide Drush tooling to automatically know the Drupal root.
drush:
service: appserver
cmd: /app/vendor/bin/drush --root=/app/web
# Provide phpcs tooling to check coding standards.
phpcs:
service: appserver
cmd: /app/vendor/bin/phpcs --colors --standard=web/profiles/custom/az_quickstart/phpcs.xml.dist web/profiles/custom/az_quickstart
# Provide PHPCBF tooling to fix coding standards.
phpcbf:
service: appserver
cmd: /app/vendor/bin/phpcbf --colors --standard=web/profiles/custom/az_quickstart/phpcs.xml.dist web/profiles/custom/az_quickstart
# Provide phpunit tooling to run unit tests.
phpunit:
service: appserver
cmd: /app/vendor/bin/phpunit --configuration /app/web/profiles/custom/az_quickstart/phpunit.xml.dist --bootstrap /app/web/core/tests/bootstrap.php /app/web/profiles/custom/az_quickstart
phpunit-fastest:
service: appserver
cmd: find web/profiles/custom/az_quickstart/ -name "*Test.php" | /app/vendor/bin/fastest -vvv "/app/vendor/bin/phpunit {} --configuration /app/web/profiles/custom/az_quickstart/phpunit.xml.dist --bootstrap /app/web/core/tests/bootstrap.php /app/web/profiles/custom/az_quickstart;"
# Provide phpstan tooling to check for code quality and deprecated code.
phpstan:
service: appserver
cmd: /app/vendor/bin/phpstan analyse --configuration web/profiles/custom/az_quickstart/phpstan.neon web/profiles/custom/az_quickstart
# Provide phpstan tooling to check for deprecated contrib module/theme code.
phpstan-contrib:
service: appserver
cmd: /app/vendor/bin/phpstan analyse --configuration web/profiles/custom/az_quickstart/phpstan-contrib.neon web/modules web/themes
yarn:
service: node
cmd: yarn
eslint:
service: node
cmd: yarn run eslint --color
# Provide a composer tooling that executes commands in the profile and then updates the attached scaffolding.
composer:
service: appserver
cmd:
# Run command against the install profile's composer.json - eg. profile dependencies.
- /usr/local/bin/composer --working-dir=/usr/local/quickstart-install-profile --no-scripts --no-update
# Now issue a composer update/install for the scaffolding folder to pull in new dependencies.
# "true" command consumes passed Lando arguments that were only intended to be passed to the previous call.
- /usr/local/bin/composer --working-dir=/app --no-scripts update && /usr/local/bin/composer --working-dir=/app install && true
xdebug-on:
service: appserver
description: Enable xdebug for Apache.
cmd: docker-php-ext-enable xdebug && /etc/init.d/apache2 reload && echo "Enabling xdebug"
user: root
xdebug-off:
service: appserver
description: Disable xdebug for Apache.
cmd: rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && /etc/init.d/apache2 reload && echo "Disabling xdebug"
user: root