generated from ddev/ddev-addon-template
-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
install.yaml
42 lines (39 loc) · 1.45 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
name: adminer
# list of files and directories listed that are copied into project .ddev directory
project_files:
- docker-compose.adminer.yaml
- docker-compose.adminer_norouter.yaml
- commands/host/adminer
pre_install_actions:
# Ensure we're on DDEV 1.23+. It's required for the `adminer` command (launch by port).
- |
#ddev-nodisplay
#ddev-description:Checking DDEV version
(ddev debug capabilities | grep corepack >/dev/null) || (echo "Please upgrade DDEV to v1.23+ to use this add-on." && false)
- |
#ddev-nodisplay
#ddev-description:Removing old adminer files
has_old_files=false
for file in "${DDEV_APPROOT}/.ddev/adminer/Dockerfile" "${DDEV_APPROOT}/.ddev/adminer/ddev-login.php"; do
if [ ! -f "${file}" ]; then
continue
fi
if grep -q '#ddev-generated' "${file}"; then
rm -f "${file}"
else
echo "${file} needs to be removed but has been modified by the user. Please check it and remove it"
has_old_files=true
fi
done
if [ "${has_old_files}" = true ]; then
exit 2
fi
post_install_actions:
- |
#ddev-description:If router disabled, directly expose port
#
if ( {{ contains "ddev-router" (list .DdevGlobalConfig.omit_containers | toString) }} ); then
printf "#ddev-generated\nservices:\n adminer:\n ports:\n - 9100:8080\n" > docker-compose.adminer_norouter.yaml
fi
- |
echo "You can now use 'ddev adminer' to launch Adminer"