From dcb3b410ff31bd834f8b9250e5f515316b5022b6 Mon Sep 17 00:00:00 2001 From: 3wc <3wc@doesthisthing.work> Date: Thu, 31 Mar 2022 01:24:33 +0200 Subject: [PATCH] feat: yet another attempt at wp-cli --- README.md | 5 +---- abra.sh | 8 ++++++-- compose.yml | 1 + entrypoint.sh.tmpl | 3 +++ 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d3719cf..aeb5baa 100644 --- a/README.md +++ b/README.md @@ -32,10 +32,7 @@ Coöp Cloud + [Wordpress](https://wordpress.org) = 🥳 ## Running WP-CLI -`abra app YOURAPPDOMAIN wp 'core check-update --major'` - -(the WP-CLI arguments need to be quoted, because of how `abra` handles -command-line arguments) +`abra app cmd YOURAPPDOMAIN app wp -- core check-update --major` ## Network (Multi-site) diff --git a/abra.sh b/abra.sh index ac50858..46a77d4 100644 --- a/abra.sh +++ b/abra.sh @@ -1,8 +1,12 @@ export PHP_UPLOADS_CONF_VERSION=v3 -export ENTRYPOINT_CONF_VERSION=v2 -export ENTRYPOINT_MAILRELAY_CONF_VERSION=v1 +export ENTRYPOINT_CONF_VERSION=v3 +export ENTRYPOINT_MAILRELAY_CONF_VERSION=v2 export MSMTP_CONF_VERSION=v3 +wp() { + /usr/local/bin/wp $@ +} + sub_wp() { CONTAINER=$(docker container ls -f "Name=${STACK_NAME}_app" --format '{{ .ID }}') if [ -z "$CONTAINER" ]; then diff --git a/compose.yml b/compose.yml index 8a5f916..9079ed6 100644 --- a/compose.yml +++ b/compose.yml @@ -10,6 +10,7 @@ services: - backend - proxy environment: + - PAGER=more - WORDPRESS_DB_HOST=db - WORDPRESS_DB_USER=wordpress - WORDPRESS_DB_PASSWORD_FILE=/run/secrets/db_password diff --git a/entrypoint.sh.tmpl b/entrypoint.sh.tmpl index 01800ba..eff899e 100644 --- a/entrypoint.sh.tmpl +++ b/entrypoint.sh.tmpl @@ -4,6 +4,9 @@ docker-php-ext-install {{ env "PHP_EXTENSIONS" }} {{ end }} +curl -z /usr/local/bin/wp -o /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar +chmod +x /usr/local/bin/wp + if [ -n "$@" ]; then "$@" fi