feat: use custom env var to disable pull actions

This commit is contained in:
Jose Diaz-Gonzalez
2018-04-11 15:11:58 -04:00
parent 2af6966c4b
commit bd2e292e1e
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 [[ "$POSTGRES_DISABLE_PULL" == "true" ]]; then
echo " ! POSTGRES_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