generated from ddev/ddev-addon-template
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinstall.yaml
45 lines (43 loc) · 1.79 KB
/
install.yaml
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
name: playwright
# list of files and directories listed that are copied into project .ddev directory
project_files:
- commands/playwright/playwright
- commands/playwright/playwright-install
- commands/playwright/playwright-init
- playwright-build/Dockerfile
- playwright-build/kasmvnc.yaml
- playwright-build/xstartup
- playwright-build/entrypoint.sh
- docker-compose.playwright.yaml
post_install_actions:
- |
#ddev-nodisplay
#ddev-description:Checking docker-compose.playwright_extras.yaml for changes
if [ -f docker-compose.playwright_extras.yaml ] && ! grep -q '#ddev-generated' docker-compose.playwright_extras.yaml; then
echo "Existing docker-compose.playwright_extras.yaml does not have #ddev-generated, so can't be updated"
exit 2
fi
- |
#ddev-nodisplay
#ddev-description:Adding all hostnames to the playwright container to make them available
cat <<-END >docker-compose.playwright_extras.yaml
#ddev-generated
services:
playwright:
external_links:
{{- $playwright_hostnames := splitList "," (env "DDEV_HOSTNAME") -}}
{{- range $i, $n := $playwright_hostnames }}
- "ddev-router:{{- replace (env "DDEV_TLD") "\\${DDEV_TLD}" (replace (env "DDEV_PROJECT") "\\${DDEV_PROJECT}" $n) -}}"
{{- end }}
END
removal_actions:
- |
#ddev-nodisplay
#ddev-description:Remove docker-compose.playwright_extras.yaml file
if [ -f docker-compose.playwright_extras.yaml ]; then
if grep -q '#ddev-generated' docker-compose.playwright_extras.yaml; then
rm -f docker-compose.playwright_extras.yaml
else
echo "Unwilling to remove '$DDEV_APPROOT/.ddev/docker-compose.playwright_extras.yaml' because it does not have #ddev-generated in it; you can manually delete it if it is safe to delete."
fi
fi