Add custom abra command to run WP-CLI
continuous-integration/drone/push Build is passing Details

Closes #2
This commit is contained in:
3wc 2020-12-14 12:31:17 +02:00
parent 5c81094a82
commit 997707189e
2 changed files with 18 additions and 0 deletions

View File

@ -16,6 +16,13 @@ Coöp Cloud + [Wordpress](https://wordpress.org) = 🥳
8. `abra app YOURAPPDOMAIN run app chown www-data:www-data /var/www/html/wp-content` to fix
file permissions (see #3)
## 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)
## Network (Multi-site)
_(Only tested using subdomains)_

11
abra-commands.sh Normal file
View File

@ -0,0 +1,11 @@
sub_wp() {
load_instance
load_instance_env
CONTAINER=$(docker container ls -f "Name=${STACK_NAME}_app" --format '{{ .ID }}')
if [ -z "$CONTAINER" ]; then
error "Can't find a container for ${STACK_NAME}_app"
exit
fi
# shellcheck disable=SC2154,SC2086
docker run -it --volumes-from "$CONTAINER" --network "container:$CONTAINER" wordpress:cli wp $abra__arg_
}