-
Notifications
You must be signed in to change notification settings - Fork 2
/
.lando.yml
88 lines (88 loc) · 4.24 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
name: az-quickstart-project
recipe: drupal10
config:
php: '8.1'
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: drupal10
MYSQL_DATABASE: drupal10
MARIADB_USER: drupal10
MARIADB_PASSWORD: drupal10
appserver:
build:
- BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD); if [ $(git ls-remote --heads https://github.com/az-digital/az_quickstart.git $BRANCH_NAME | wc -l) = 1 ]; then PROFILE_BRANCH="$BRANCH_NAME"; else PROFILE_BRANCH=main; fi; composer require --no-update drupal/core-recommended:* zaporylie/composer-drupal-optimizations:* az-digital/az_quickstart:dev-${PROFILE_BRANCH}
- BRANCH_NAME=$(git 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_BRANCH="$BRANCH_NAME"; else DEV_BRANCH=main; fi; composer require --dev --no-update az-digital/az-quickstart-dev:dev-${DEV_BRANCH}
- composer install -o
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: drush --root=/app/web site:install [email protected] --account-name=azadmin --account-pass=azadmin2024 --db-url=mysql://drupal10:drupal10@database:3306/drupal10 -y --verbose
# Provide tooling to set the Quickstart dependency.
quickstart-branch:
service: appserver
cmd: /bin/bash /app/quickstart_branch.sh
level: app
options:
branch:
passthrough: true
describe: Branch to use, e.g. UADIGITAL-1234.
interactive:
type: input
message: Branch to use, e.g. UADIGITAL-1234.
default: main
weight: 600
# 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
# After running 'install' you can use this command prepare your lando site for migration.
migrate-setup:
service: appserver
cmd:
- /usr/bin/mysql -h database -uroot -e "CREATE DATABASE IF NOT EXISTS migrate; GRANT ALL PRIVILEGES ON migrate.* TO 'drupal10'@'%' IDENTIFIED by 'drupal10';"
- chmod 777 /app/web/sites/default/settings.php
- echo "\$databases['migrate']['default'] = [\n 'driver' => 'mysql',\n 'namespace' => 'Drupal\Core\Database\Driver\mysql',\n 'database' => 'migrate',\n 'username' => 'drupal10',\n 'password' => 'drupal10',\n 'port' => '3306',\n 'host' => 'database',\n 'prefix' => '',\n];" >> /app/web/sites/default/settings.php
- chmod 644 /app/web/sites/default/settings.php
- mkdir /app/web/sites/default/files/migrate_files
- /app/vendor/bin/drush --root=/app/web en -y az_migration az_carousel az_paragraphs_html
- /app/vendor/bin/drush --root=/app/web cset -y az_migration.settings migrate_d7_filebasepath " "
- /app/vendor/bin/drush --root=/app/web cset -y az_migration.settings migrate_d7_public_path "sites/default/files/migrate_files"
# After running 'migrate-setup' you can use this command to import your
# database into the newly created migrate database.
'migrate-db-import <file>':
service: :host
description: YOU MUST RUN LANDO INSTALL FIRST Imports a migration site dump file into a database service
cmd: /bin/bash /app/scripts/lando/migrate-db-import.sh
user: root
options:
host:
description: The database service to use
default: database
alias:
- h
no-wipe:
description: Do not destroy the existing database before an import
boolean: true