feat: use custom env var to disable pull actions

This commit is contained in:
Jose Diaz-Gonzalez
2018-04-11 15:11:39 -04:00
parent 07f630b545
commit 606fc7f9be
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 [[ "$MYSQL_DISABLE_PULL" == "true" ]]; then
echo " ! MYSQL_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