forked from az-digital/az_quickstart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.lando.yml
107 lines (107 loc) · 5.75 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
name: az_quickstart
recipe: drupal9
config:
php: '7.4'
via: apache:2.4
webroot: web
database: mariadb:10.4
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.4
command: docker-entrypoint.sh mariadbd
restart: always
ports:
- '3306'
environment:
MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: 'true'
MARIADB_DATABASE: drupal9
MYSQL_DATABASE: drupal9
MARIADB_USER: drupal9
MARIADB_PASSWORD: drupal9
appserver:
overrides:
environment:
SIMPLETEST_DB: 'mysql://drupal9:drupal9@database/drupal9'
SIMPLETEST_BASE_URL: 'http://appserver'
MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", {"browserName":"chrome","chromeOptions":{"args":["--disable-gpu","--disable-dev-shm-usage","--headless","--no-sandbox"]}}, "http://chromedriver:9515"]'
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 drupal/core-recommended:* zaporylie/composer-drupal-optimizations:* 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
node:
type: node:12
build:
- yarn install
chromedriver:
type: compose
services:
image: drupalci/webdriver-chromedriver:production
command: chromedriver --log-path=/tmp/chromedriver.log --verbose --whitelisted-ips=
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=azadmin --db-url=mysql://drupal9:drupal9@database:3306/drupal9 -y --verbose
# Provide Drush tooling to automatically know the Drupal root.
drush:
service: appserver
cmd: /app/vendor/bin/drush --root=/app/web
# Provide Drupal console tooling to automatically know the Drupal root.
drupal:
service: appserver
cmd: /app/vendor/bin/drupal --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 web/profiles/custom/az_quickstart/phpunit.xml.dist --bootstrap web/core/tests/bootstrap.php 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 web/profiles/custom/az_quickstart/phpunit.xml.dist --bootstrap web/core/tests/bootstrap.php 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