forked from department-of-veterans-affairs/va.gov-cms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.lando.yml
252 lines (221 loc) · 9 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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
name: va-gov-cms
recipe: drupal8
config:
webroot: docroot
php: "7.4"
# Match with terraform-aws-vsp-cms/rds.tf (another repo)
# Match with .tugboat/config.yml (this repo)
database: mariadb:10.5
events:
post-db-import:
- appserver: cd $LANDO_WEBROOT && drush deploy
# Runs composer install after app starts
post-start:
# Install the Task task runner/build tool.
- appserver: cd /app && ./scripts/install_task_runner.sh
# Composer options are in composer.json, 'config' key.
- appserver: cd $LANDO_MOUNT && composer install
- appserver: cd $LANDO_MOUNT && composer va:theme:compile
- appserver: cd $LANDO_MOUNT && composer va:web:install
# Pulled from https://github.com/AaronFeledy/lando-examples/tree/master/landofile-changed-alert.
# Alert user if landofile and current environment are out of sync.
- appserver: cd /app && sha1sum --status -c ~/.lando.yml.sha1 || echo $(echo $($TXT_ALERT)Your Lando environment is outdated! Please run \"lando rebuild\" to update.$($TXT_RESET))
# After code changes
post-update:
# Composer options are in composer.json, 'config' key.
- appserver: cd $LANDO_MOUNT && composer install
- appserver: cd $LANDO_WEBROOT && drush updatedb --cache-clear=0 -y
- appserver: cd $LANDO_WEBROOT && drush cache:rebuild -y
services:
appserver:
run_as_root:
- "apt-get update -y"
- "apt-get install build-essential chrpath libssl-dev libxft-dev libfreetype6-dev libfreetype6 libfontconfig1-dev libfontconfig1 python -y"
# cypress-axe dependencies - https://docs.cypress.io/guides/getting-started/installing-cypress.html#System-requirements
- "apt-get install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb -y"
- .lando/scripts/blackfire-init.sh
- php $(curl -w "%{filename_effective}" -LO $(curl -s https://api.github.com/repos/DataDog/dd-trace-php/releases | grep browser_download_url | grep 'setup[.]php' | head -n 1 | cut -d '"' -f 4)) --enable-profiling --php-bin=php
- yes | pecl install memcache-4.0.5.2 && docker-php-ext-enable memcache
- rm -f /usr/local/etc/php/conf.d/docker-php-ext-memcached.ini
- /etc/init.d/apache2 reload
xdebug: true
config:
php: .lando/zzz-lando-my-custom.ini
build:
# Pulled from https://github.com/AaronFeledy/lando-examples/tree/master/landofile-changed-alert.
# Save a hash of our lando config for future integrity checking.
- sha1sum /app/.lando.yml > ~/.lando.yml.sha1
overrides:
# Reduces likelihood of Chromium running out of shared memory and crashing during longer or
# more complicated behavioral tests.
ipc: host
environment:
# You must manually `export` these ENV vars before uncommenting, then run `lando rebuild`
# @see /README.md Build Trigger section
# VA_CMS_BOT_GITHUB_AUTH_TOKEN: ${VA_CMS_BOT_GITHUB_AUTH_TOKEN}
# CMS_JENKINS_VA_CMS_BOT_TOKEN: ${CMS_JENKINS_VA_CMS_BOT_TOKEN}
# ENVIRONMENT_TYPE: ${ENVIRONMENT_TYPE}
# JENKINS_BUILD_ENV: ${JENKINS_BUILD_ENV}
# Support debugging Drush with XDEBUG. Listen in PHPStorm then `lando drush` to trigger xdebug.
PHP_IDE_CONFIG: "serverName=appserver"
# These add colors https://github.com/AaronFeledy/lando-examples/tree/master/colorful-messages
TXT_RESET: tput sgr 0
TXT_RED: tput setaf 1
TXT_GREEN: tput setaf 2
TXT_YELLOW: tput setaf 3
TXT_CYAN: tput setaf 6
TXT_ALERT: tput setab 1 && tput setaf 7
BLACKFIRE_CLIENT_ID: ~
BLACKFIRE_CLIENT_TOKEN: ~
BLACKFIRE_SERVER_ID: ~
BLACKFIRE_SERVER_TOKEN: ~
# Don't test PIV login locally, where it is disabled
CYPRESS_TAGS: "not @ignore and not @piv"
mailhog:
type: mailhog
portforward: true
hogfrom:
- appserver
memcache:
type: memcached:1
mem: 1024
# Uncomment this to work on site build triggers, then export ENV vars below, then `lando rebuild`.
# Must use lando 3.0.0-rc9+
# @see /README.md Build Trigger section
# va-socks-proxy:
# type: compose
# services:
# image: va/socks-proxy
# build:
# context: ./docker/images/va-socks-proxy
# dockerfile: Dockerfile
# restart: on-failure
# # Only way to run a custom entrypoint in Lando
# # @see https://docs.devwithlando.io/tutorials/compose.html#configuration
# command: /entrypoint.sh
# environment:
# # Must export these first, @see /README.md.
# VA_SOCKS_PROXY_PRIVATE_KEY: ${VA_SOCKS_PROXY_PRIVATE_KEY}
# VA_SOCKS_PROXY_SSH_CONFIG: ${VA_SOCKS_PROXY_SSH_CONFIG}
# Lando Tooling
#
# The list of commands below, under 'tooling' become `lando x` commands.
#
# You do NOT have to restart lando or the environment when you make changes to this file.
# You DO have to reload the command cache by calling `lando` by itself or `lando --clear`.
#
# See https://docs.lando.dev/config/tooling.html#usage
tooling:
migrate-sync:
description: Copy migration ymls from va_gov_migrate to config/sync and run config import. Always edit in va_gov_migrate.
service: appserver
cmd: cp -r /app/docroot/modules/custom/va_gov_migrate/config/install/. /app/config/sync/ && /app/bin/drush config-import -y && /app/bin/drush config-export -y
pre-commit:
description: Run pre-commit checks
service: appserver
cmd: /app/scripts/lando-precommit.sh
test:
description: Run all VA.gov tests, as defined in tests.yml. Add arguments to run subsets of tests. For example. "lando test web" will run all of the "va/web/*" tests.
service: appserver
cmd: ./bin/task --taskfile=tests.yml
env:
SKIP_REPORTING: 1
# "drush" being here overrides the default "lando drush" command.
# Using /app/bin/drush means we are using the site-local drush directly.
# The reason it does not need "service" is because "drush" already has "service" set!
drush:
cmd: /app/bin/drush
# Build the web front-end
web-build:
service: appserver
cmd: "composer va:web:build"
xdebug-on:
service: appserver
description: Enable xdebug for apache.
cmd: "docker-php-ext-enable xdebug && /etc/init.d/apache2 reload"
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"
user: root
memcache-on:
service: appserver
description: Enable Memcache.
cmd: |
docker-php-ext-enable memcache
/etc/init.d/apache2 reload
/app/bin/drush cache:rebuild
user: root
memcache-off:
service: appserver
description: Disable memcache.
cmd: |
rm -f /usr/local/etc/php/conf.d/docker-php-ext-memcache.ini
/etc/init.d/apache2 reload
/app/bin/drush cache:rebuild
user: root
phpunit:
service: appserver
description: "Run VA PHPUnit tests found in va/tests/phpunit: lando phpunit. Syntax: lando phpunit"
cmd: "./bin/task --taskfile=tests.yml va/tests/phpunit --"
env:
SKIP_REPORTING: 1
phpunit-run:
service: appserver
description: "Run specific PHPUnit tests: lando phpunit-run {docroot/MODULE/PATH/TO/TESTS} --filter {testName}"
cmd: "/app/bin/phpunit --debug --exclude-group disabled --verbose --colors=always"
phpstan:
service: appserver
description: "Run PHPStan static analysis on custom code."
cmd: "./bin/phpstan analyze"
behat:
service: appserver
description: "Run behat tests located in ./tests/behat"
cmd:
- .lando/scripts/behat.sh
test_filter_test:
service: appserver
description: "Run this command to see the strange problem where `lando test behat` does not work."
cmd: "./bin/task --taskfile=tests.yml va/tests/behat"
env:
SKIP_REPORTING: 1
test_performance:
service: appserver
cmd: "php scale.php"
# NPM and NODE are now installed via composer install: this ensures version consistency.
npm:
service: appserver
cmd: /app/bin/npm
node:
service: appserver
cmd: /app/bin/npm
# Deprecated.
# Moved to scripts/sync-db.sh
sync-db:
service: appserver
description: This command has moved to a non-lando command, from app root run like this `scripts/sync-db.sh`.
cmd: 'echo "This command has moved to a non-lando command, from app root run like this `scripts/sync-db.sh`."'
# Deprecated.
# Moved to scripts/sync-files.sh
sync-files:
service: appserver
description: This command has moved to a non-lando command, from app root run like this `scripts/sync-files.sh`.
cmd: 'echo "This command has moved to a non-lando command, from app root run like this `scripts/sync-files.sh`."'
blackfire:
service: appserver
user: root
blackfire-agent:
description: Start/Stop/Restart Blackfire agent service
cmd:
- /etc/init.d/blackfire-agent
service: appserver
user: root
task:
description: Run Task
service: appserver
cmd:
- ./bin/task
env:
SKIP_REPORTING: 1
RETURN_EXIT_CODE: 1