feat: allow skipping pulling an image for the redis plugin when REDIS_DISABLE_PULL=true

This commit is contained in:
Jody McIntyre
2018-03-27 12:58:40 -04:00
committed by Jose Diaz-Gonzalez
parent 258a1c9de5
commit 956e22962e
3 changed files with 17 additions and 0 deletions

View File

@@ -5,6 +5,11 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
plugin-install() {
pull-docker-image() {
declare IMAGE="$1"
if [[ "$REDIS_DISABLE_PULL" == "true" ]]; then
echo " ! REDIS_DISABLE_PULL environment variable detected. Not running pull command." 1>&2
echo " ! docker pull ${IMAGE}" 1>&2
return
fi
if [[ "$(docker images -q "${IMAGE}" 2> /dev/null)" == "" ]]; then
docker pull "${IMAGE}"
fi