Add custom abra command to run WP-CLI

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

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_
}