Skip to content

Commit

Permalink
fix: pull the new docker image when upgrading a service if DOCKER_IMA…
Browse files Browse the repository at this point in the history
…GE_PULL is not disabled

Refs dokku/dokku-clickhouse#51
  • Loading branch information
Jose Diaz-Gonzalez committed Feb 7, 2023
1 parent 203a6f6 commit ba1a387
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions subcommands/upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ service-upgrade-cmd() {
return
fi

if ! service_image_exists "$SERVICE"; then
if [[ "$PLUGIN_DISABLE_PULL" == "true" ]]; then
dokku_log_warn "${PLUGIN_DISABLE_PULL_VARIABLE} environment variable detected. Not running pull command." 1>&2
dokku_log_warn " docker pull ${IMAGE}" 1>&2
dokku_log_warn "$PLUGIN_SERVICE service $SERVICE upgrade 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

service_commit_config "$SERVICE"

dokku_log_info2 "Upgrading $SERVICE to $NEW_PLUGIN_IMAGE_TAG"
Expand Down

0 comments on commit ba1a387

Please sign in to comment.