/
.lando.yml
213 lines (212 loc) · 9.59 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
name: portlandor
recipe: pantheon
config:
framework: drupal9
site: portlandor
id: 5c6715db-abac-4633-ada8-1c9efe354629
index: false
edge: false
cache: false
composer_version: 2
proxy:
solr:
- solr.lndo.site:8983
services:
appserver:
build_as_root:
- sed 's|mozilla\/AddTrust_External_Root.crt|#mozilla\/AddTrust_External_Root.crt|g' -i /etc/ca-certificates.conf
- /bin/sh -c "cp /app/cop_ca_*.crt /usr/local/share/ca-certificates/"
- update-ca-certificates
build:
- "/app/vendor/bin/phpcs --config-set installed_paths /app/vendor/drupal/coder/coder_sniffer"
run:
- terminus self:update
- terminus self:plugin:reload
- terminus self:plugin:install pantheon-systems/terminus-secrets-plugin
- terminus self:plugin:install pantheon-systems/terminus-composer-plugin
xdebug: false
config:
php: xdebug.ini
overrides:
environment:
XDEBUG_MODE:
DRUSH_OPTIONS_URI: "https://portlandor.lndo.site"
# Move /app/vendor/bin from the start of the path to the end so that `composer` executes /usr/local/bin/composer
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/var/www/.composer/vendor/bin:/srv/bin:/app/vendor/bin
node:
type: node:custom
overrides:
image: cimg/node:lts-browsers
environment:
NODE_EXTRA_CA_CERTS: /app/cop_ca.pem
build_as_root:
- /bin/sh -c "mkdir /home/node"
- /bin/sh -c "chmod -R 777 /home/node"
run_as_root:
- /bin/sh -c "adduser www-data node"
- /bin/sh -c "adduser www-data dialout"
- /bin/sh -c "adduser node dialout"
- /bin/sh -c "chmod -R 777 /var/www"
build:
- echo "Installing Node.js dependencies and building theme..."
- npm -C /app/web/themes/custom/cloudy install
- npm -C /app/web/themes/custom/cloudy run build
solr:
type: solr:8
portforward: true
config:
dir: private/solr-conf
tooling:
drush:
description: CUSTOM Run drush commands
service: appserver
cmd: drush --root=/app/web
drupalcs:
service: appserver
cmd: "/app/vendor/bin/phpcs --standard=Drupal,DrupalPractice"
description: Run phpcs Drupal Coding Standards against a given file or directory.
drupalcbf:
service: appserver
cmd: "/app/vendor/bin/phpcbf --standard=Drupal"
description: Automatically fix Drupal coding standards suggestions.
node:
description: CUSTOM Run node commands
service: node
npm:
description: CUSTOM Run npm commands within cloudy
service: node
cmd: npm -C /app/web/themes/custom/cloudy
yarn-percy:
description: CUSTOM Run yarn commands
service: node
cmd: yarn --cwd /app/tests/percy
jest:
description: CUSTOM Run Jest tests
dir: /app/tests/percy
cmd:
- appserver: drush uli > superAdmin_uli.log
- appserver: drush uli --mail xinju.wang@portlandoregon.gov > superAdmin_uli_2.log
- appserver: drush uli --mail ally.admin@portlandoregon.gov > ally_uli.log
- appserver: drush uli --mail marty.member@portlandoregon.gov > marty_uli.log
- node: node node_modules/puppeteer/install.js
- node: npm run jest-test
jest-full:
description: CUSTOM Run full regression Jest tests
dir: /app/tests/percy
cmd:
- appserver: drush uli > superAdmin_uli.log
- appserver: drush uli --mail ally.admin@portlandoregon.gov > ally_uli.log
- appserver: drush uli --mail marty.member@portlandoregon.gov > marty_uli.log
- node: npm run jest-full
jest-sandbox:
description: CUSTOM Run sandbox Jest tests
dir: /app/tests/percy
cmd:
- appserver: drush uli > superAdmin_uli.log
- node: npm run jest-sandbox
latest:
description: CUSTOM Download and import the latest database from Dev
cmd:
- appserver: mkdir -p /app/artifacts
- appserver: echo "Downloading latest dev database..."
- appserver: rm -f /app/artifacts/database.tar.gz
- appserver: terminus backup:get portlandor.dev --element=database --to=/app/artifacts/database.tar.gz
- database: echo "Importing database..."
- database: cd /app && /helpers/sql-import.sh artifacts/database.tar.gz
latest-live:
description: CUSTOM Download and import the latest database from Live
cmd:
- appserver: mkdir -p /app/artifacts
- appserver: echo "Downloading latest live database..."
- appserver: rm -f /app/artifacts/database.tar.gz
- appserver: terminus backup:get portlandor.live --element=database --to=/app/artifacts/database.tar.gz
- database: echo "Importing database..."
- database: cd /app && /helpers/sql-import.sh artifacts/database.tar.gz
demo:
description: CUSTOM Download and import the latest test content from a demo backup
cmd:
- appserver: mkdir -p /app/artifacts
- appserver: echo "Downloading latest database..."
- appserver: rm -f /app/artifacts/demo-database.tar.gz
- appserver: terminus backup:get portlandor.demo --element=database --to=/app/artifacts/demo-database.tar.gz
- database: echo "Importing database..."
- database: cd /app && /helpers/sql-import.sh artifacts/demo-database.tar.gz
- appserver: echo "Clearing cache..."
- appserver: drush cr -y
refresh:
description: CUSTOM Refresh branch by installing Composer dependencies and importing Drupal config, etc. Run after every merge from master.
cmd:
- appserver: /bin/bash -c "if [[ \$(composer install --dry-run -d /app --no-interaction 2>&1 | grep -oPc 'Removing drupal/\S+') -gt 0 ]]; then { echo Composer is about to remove one or more modules... Let\'s disable them in Drupal first.; for module in \$(composer install --dry-run -d /app --no-interaction 2>&1 | grep -oP 'Removing drupal/\K\S+'); do { echo Disabling \$module...; drush pmu \$module -y;} done } fi || true"
- appserver: echo "Installing Composer dependencies..."
- appserver: composer install -d /app
- appserver: echo "Clearing cache..."
- appserver: drush cr -y
- appserver: echo "Run drush updb -y..."
- appserver: drush updb -y
- appserver: echo "Run drush cim -y..."
- appserver: drush cim -y
- appserver: echo "Import interface translations..."
- appserver: drush locale:check > /dev/null
- appserver: drush locale:update > /dev/null
- appserver: drush locale:import es ../translations/custom-translations.es.po --type=customized --override=all 2> /dev/null
- appserver: drush locale:import ru ../translations/custom-translations.ru.po --type=customized --override=all 2> /dev/null
- appserver: drush locale:import vi ../translations/custom-translations.vi.po --type=customized --override=all 2> /dev/null
- appserver: drush locale:import zh-hans ../translations/custom-translations.zh-hans.po --type=customized --override=all 2> /dev/null
- appserver: echo "Clearing cache..."
- appserver: drush cr -y
- node: echo "Building theme asset files..."
- node: npm -C /app/web/themes/custom/cloudy install
- node: npm -C /app/web/themes/custom/cloudy run build
reindex:
description: CUSTOM Reindex the Solr searcher
service: appserver
cmd:
- echo "Reindexing the Solr server... (this might take several minutes; use 'lando reindex &' to run the command in the background)"
- drush --root=/app/web search-api:reset-tracker
- drush --root=/app/web search-api:index > /dev/null 2>&1
- echo "Done reindexing the Solr server."
cupex:
description: CUSTOM Composer update, database update, and config export to get a clean module or theme update
cmd:
- appserver: echo "Updating Composer dependencies..."
- appserver: composer update
- appserver: echo "Run database updates..."
- appserver: drush updb -y
- appserver: echo "Exporting Drupal config..."
- appserver: drush cex -y
xdebug-on:
service: appserver
description: CUSTOM Enable xdebug for nginx.
cmd: docker-php-ext-enable xdebug && pkill -o -USR2 php-fpm && echo "Enabling xdebug"
user: root
xdebug-off:
service: appserver
description: CUSTOM Disable xdebug for nginx.
cmd: rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && pkill -o -USR2 php-fpm && echo "Disabling xdebug"
user: root
install-certs:
description: CUSTOM Installs City of Portland certificate authority certificates used for TLS decryption
service: appserver
cmd:
- /bin/sh -c "cp /app/cop_ca_*.crt /usr/local/share/ca-certificates/"
- update-ca-certificates
user: root
update-core:
description: CUSTOM Updates Drupal core to latest version
cmd:
- appserver: composer update "drupal/core-*" --with-all-dependencies
- appserver: drush cr -y
- appserver: drush updb -y
- appserver: drush cex -y
- appserver: drush cr -y
update-interface-translations:
description: CUSTOM Downloads and imports updated interface translations for core, contributed modules, and custom modules. Exports customized translations.
cmd:
- appserver: drush cset locale.settings translation.use_source remote_and_local -y
- appserver: drush locale:check
- appserver: drush locale:update
- appserver: drush locale:export es --types=customized > translations/custom-translations.es.po
- appserver: drush locale:export ru --types=customized > translations/custom-translations.ru.po
- appserver: drush locale:export vi --types=customized > translations/custom-translations.vi.po
- appserver: drush locale:export zh-hans --types=customized > translations/custom-translations.zh-hans.po
- appserver: drush cset locale.settings translation.use_source local -y