-
Notifications
You must be signed in to change notification settings - Fork 2
/
.lando.yml
179 lines (179 loc) · 7.19 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
name: employees
recipe: pantheon
config:
framework: drupal9
site: employees
id: 7f99fc39-aa02-4ea5-a753-9ea5e2b38435
index: false
edge: false
cache: false
composer_version: 2
proxy:
solr:
- solr-employees.lndo.site:8983
services:
# The headers for / are too large and cause the URL scanner to return HPE_HEADER_OVERFLOW errors
appserver_nginx:
scanner:
path: /user/login
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
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_CONFIG:
XDEBUG_MODE:
DRUSH_OPTIONS_URI: "https://employees.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 "chmod -R 775 /var/www"
build:
- echo "Installing Node.js dependencies and building theme..."
- npm -C /app/web/themes/custom/westy install
- npm -C /app/web/themes/custom/westy 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
node:
description: CUSTOM Run node commands
service: node
npm:
description: CUSTOM Run npm commands
service: node
cmd: npm -C /app/web/themes/custom/westy
yarn:
description: CUSTOM Run yarn commands
service: node
cmd: yarn --cwd /app/web/themes/custom/westy
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 [email protected] > superAdmin_uli_2.log
# - appserver: drush uli --mail [email protected] > ally_uli.log
# - appserver: drush uli --mail [email protected] > marty_uli.log
- 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 [email protected] > ally_uli.log
# - appserver: drush uli --mail [email protected] > 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 employees.dev --element=database --to=/app/artifacts/database.tar.gz
- appserver: 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 employees.live --element=database --to=/app/artifacts/database.tar.gz
- database: echo "Importing database..."
- database: cd /app && /helpers/sql-import.sh artifacts/database.tar.gz
refresh:
description: 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/\w+') -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\w+'); do { echo Disabling \$module...; drush pmu \$module -y;} done } fi"
- appserver: echo "Installing Composer dependencies..."
- appserver: composer install -d /app
- appserver: echo "Clearing cache..."
- appserver: drush cr -y || true
- appserver: echo "Run drush updb -y..."
- appserver: drush updb -y
- appserver: echo "Run drush cim -y..."
- appserver: drush cim -y
- appserver: echo "Clearing cache..."
- appserver: drush cr -y
- node: echo "Building theme asset files..."
- node: npm -C /app/web/themes/custom/westy install
- node: npm -C /app/web/themes/custom/westy 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 -W
- 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