Skip to content

Commit

Permalink
Added warden shell command for easily dropping into the php-fpm c…
Browse files Browse the repository at this point in the history
…ontainer
  • Loading branch information
davidalger committed Jul 3, 2019
1 parent 1f4327b commit be47e3f
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
0.1.2
===============

* Added max_allowed_packet=1024M to db containers for M1 and M2 to avoid imports or upgrade routines from failing on large packets.
* Added `warden shell` command for easily dropping into the `php-fpm` container (container name is configurable for supporting "local" environment types)
* Added `max_allowed_packet=1024M` to `db` containers for M1 and M2 environments to avoid imports or upgrade routines from failing on large packets.
* Changed `php-fpm` and `php-debug` to use custom images based on `centos:7` as opposed to the `alpine3.9` based official php-fpm images to avoid seg-faults when Source Guardian loader is installed alongside Xdebug.
* Fixed issue with DEFINER stripping in `db import` allowing it to correctly strip from both TRIGGERS and ALGORITHM clauses.

Expand Down
2 changes: 1 addition & 1 deletion bin/warden
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ readonly WARDEN_SSL_DIR="${WARDEN_HOME_DIR}/ssl"
declare WARDEN_HELP=
declare WARDEN_PARAMS=()
declare WARDEN_COMMAND=
declare WARDEN_ANYARGS=(env db)
declare WARDEN_ANYARGS=(env db shell)
declare WARDEN_VERBOSE=

## parse first argument as command and determine validity
Expand Down
17 changes: 17 additions & 0 deletions commands/shell.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!" && exit 1

source "${WARDEN_DIR}/utils/env.sh"
WARDEN_ENV_PATH="$(locateEnvPath)" || exit $?
loadEnvConfig "${WARDEN_ENV_PATH}" || exit $?

## set defaults for this command which can be overriden either using exports in the user
## profile or setting them in the .env configuration on a per-project basis
WARDEN_ENV_SHELL_COMMAND=${WARDEN_ENV_SHELL_COMMAND:-bash}
WARDEN_ENV_SHELL_CONTAINER=${WARDEN_ENV_SHELL_CONTAINER:-php-fpm}

## simply allow the return code from sub-command to bubble up per normal
trap '' ERR

"${WARDEN_DIR}/bin/warden" env exec "${WARDEN_ENV_SHELL_CONTAINER}" \
"${WARDEN_ENV_SHELL_COMMAND}" "${WARDEN_PARAMS[@]}" "$@"
12 changes: 12 additions & 0 deletions commands/shell.help
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
[[ ! ${WARDEN_COMMAND} ]] && >&2 echo -e "\033[31mThis script is not intended to be run directly!" && exit 1

WARDEN_USAGE=$(cat <<EOF
\033[33mUsage:\033[0m
shell [args]
\033[33mOptions:\033[0m
-h, --help Display this help menu
-v, --verbose Increases verbosity of output
EOF
)
1 change: 1 addition & 0 deletions commands/usage.help
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Warden version 0.1.2
env Controls an environment from any point within the root project directory
install Initializes or updates warden configuration on host machine
restart Restarts warden managed containers
shell Launches into a shell within the current project environment
sign-certificate Signs a wildcard certificate including all passed hostnames on the SAN list
start Start services
stop Stop services
Expand Down

0 comments on commit be47e3f

Please sign in to comment.