-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathwpcli.sh
More file actions
executable file
·26 lines (23 loc) · 681 Bytes
/
wpcli.sh
File metadata and controls
executable file
·26 lines (23 loc) · 681 Bytes
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
#!/bin/bash
set -o errexit
set -o errtrace
set -o nounset
# shellcheck disable=SC2154
trap '_es=${?};
printf "${0}: line ${LINENO}: \"${BASH_COMMAND}\"";
printf " exited with a status of ${_es}\n";
exit ${_es}' ERR
# shellcheck disable=SC1091
source .env
WEB_WP_DIR=/var/www/index
WEB_WP_URL=http://localhost:8080
# Call WP-CLI with appropriate site arguments via Docker
docker compose exec \
--env WP_ADMIN_USER="${WP_ADMIN_USER}" \
--env WP_ADMIN_PASS="${WP_ADMIN_PASS}" \
--env WP_ADMIN_EMAIL="${WP_ADMIN_EMAIL}" \
index-web \
/usr/local/bin/wp \
--path="${WEB_WP_DIR}" \
--url="${WEB_WP_URL}" \
"${@}"