feat: use custom env var to disable pull actions

This commit is contained in:
Jose Diaz-Gonzalez
2018-04-11 15:11:26 -04:00
parent e08b8e60f8
commit e9cd0094fc
3 changed files with 17 additions and 0 deletions

View File

@@ -30,6 +30,12 @@ service_create() {
service_parse_args "${@:2}"
if ! docker images | grep -e "^$PLUGIN_IMAGE " | grep -q " $PLUGIN_IMAGE_VERSION " ; then
if [[ "$MONGO_DISABLE_PULL" == "true" ]]; then
dokku_log_warn "MONGO_DISABLE_PULL environment variable detected. Not running pull command." 1>&2
dokku_log_warn " docker pull ${IMAGE}" 1>&2
dokku_log_warn "$PLUGIN_SERVICE service creation failed"
exit 1
fi
docker pull "$PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION" || dokku_log_fail "$PLUGIN_SERVICE image $PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION pull failed"
fi