generated from ddev/ddev-addon-template
-
Notifications
You must be signed in to change notification settings - Fork 9
/
install.yaml
51 lines (44 loc) · 1.87 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
46
47
48
49
50
51
name: ddev-cypress
# pre_install_actions - list of actions to run before installing the addon.
# Examples would be removing an extraneous docker volume,
# or doing a sanity check for requirements.
pre_install_actions:
# list of files and directories listed that are copied into project .ddev directory
project_files:
- docker-compose.cypress.yaml
- commands/cypress/cypress-open
- commands/cypress/cypress-run
# List of files and directories that are copied into the global .ddev directory
global_files:
post_install_actions:
- |
#ddev-nodisplay
#ddev-description:Checking docker-compose.cypress_extras.yaml for changes
if [ -f docker-compose.cypress_extras.yaml ] && ! grep -q '#ddev-generated' docker-compose.cypress_extras.yaml; then
echo "Existing docker-compose.cypress_extras.yaml does not have #ddev-generated, so can't be updated"
exit 2
fi
- |
#ddev-nodisplay
#ddev-description:Adding all hostnames to the cypress container to make them available
cat <<-END >docker-compose.cypress_extras.yaml
#ddev-generated
services:
cypress:
external_links:
{{- $cypress_hostnames := splitList "," (env "DDEV_HOSTNAME") -}}
{{- range $i, $n := $cypress_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.cypress_extras.yaml file
if [ -f docker-compose.cypress_extras.yaml ]; then
if grep -q '#ddev-generated' docker-compose.cypress_extras.yaml; then
rm -f docker-compose.cypress_extras.yaml
else
echo "Unwilling to remove '$DDEV_APPROOT/.ddev/docker-compose.cypress_extras.yaml' because it does not have #ddev-generated in it; you can manually delete it if it is safe to delete."
fi
fi