refactor: extract release_and_deploy calls to a plugin trigger

Better would be to separate the release and deploy aspects into distinct triggers - as well as have it release a specific image - but this is a good first pass.
This commit is contained in:
Jose Diaz-Gonzalez
2020-10-10 17:32:21 -04:00
committed by Jose Diaz-Gonzalez
parent 1b4559c4a4
commit 696df45306
6 changed files with 28 additions and 5 deletions

View File

@@ -158,7 +158,7 @@ ps_start() {
fi
if [[ "$RUNNING" != "true" ]]; then
release_and_deploy "$APP" "$IMAGE_TAG"
plugn trigger release-and-deploy "$APP" "$IMAGE_TAG"
else
dokku_log_warn "App $APP already running"
fi
@@ -196,7 +196,7 @@ ps_restart() {
local IMAGE_TAG=$(get_running_image_tag "$APP")
if (is_deployed "$APP"); then
release_and_deploy "$APP" "$IMAGE_TAG"
plugn trigger release-and-deploy "$APP" "$IMAGE_TAG"
else
dokku_log_warn "App $APP has not been deployed"
fi
@@ -235,7 +235,7 @@ ps_scale() {
else
if [[ "$(fn-ps-can-scale "$APP")" == "true" ]]; then
set_scale "$APP" "$@"
release_and_deploy "$APP" "$IMAGE_TAG"
plugn trigger release-and-deploy "$APP" "$IMAGE_TAG"
else
dokku_log_fail "App contains DOKKU_SCALE file and cannot be manually scaled"
fi