feat: allow specifying a single process type to restart

This changes restarts to drop the 'release' part that currently gets triggered, which also helps reduce the possibility that a new image layer will be added due to predeploy deploy triggers.

Note that the old method essentially halfway-rebuilt the app (which was what added the extra layer). This refactor removes that, which is a bc-break.

Additionally, scaling processes will result in deploying _only_ restarting the processes being scaled.

Closes #2184
This commit is contained in:
Jose Diaz-Gonzalez
2021-09-05 00:02:46 -04:00
parent 8f7f03a7d8
commit b48b79f5ca
13 changed files with 115 additions and 36 deletions

View File

@@ -9,7 +9,8 @@ source "$PLUGIN_AVAILABLE_PATH/scheduler-docker-local/internal-functions"
trigger-scheduler-docker-local-scheduler-deploy() {
declare desc="deploys an image tag for a given application"
declare trigger="scheduler-deploy"
declare DOKKU_SCHEDULER="$1" APP="$2" IMAGE_TAG="$3"
declare DOKKU_SCHEDULER="$1" APP="$2" IMAGE_TAG="$3" PROCESS_TYPE="$4"
local PROCESS_TYPE
if [[ "$DOKKU_SCHEDULER" != "docker-local" ]]; then
return
@@ -28,7 +29,7 @@ trigger-scheduler-docker-local-scheduler-deploy() {
local IMAGE_SOURCE_TYPE="dockerfile"
[[ "$DOKKU_HEROKUISH" == "true" ]] && IMAGE_SOURCE_TYPE="herokuish"
[[ "$DOKKU_CNB" == "true" ]] && IMAGE_SOURCE_TYPE="pack"
local oldids=$(get_app_container_ids "$APP")
local oldids=$(get_app_container_ids "$APP" "$PROCESS_TYPE")
DOKKU_NETWORK_BIND_ALL="$(plugn trigger network-get-property "$APP" bind-all-interfaces)"
DOKKU_DOCKER_STOP_TIMEOUT="$(config_get "$APP" DOKKU_DOCKER_STOP_TIMEOUT || true)"
@@ -54,6 +55,10 @@ trigger-scheduler-docker-local-scheduler-deploy() {
local PROC_TYPE=${line%%=*}
local PROC_COUNT=${line#*=}
if [[ -n "$PROCESS_TYPE" ]] && [[ "$PROC_TYPE" != "$PROCESS_TYPE" ]]; then
continue
fi
if [[ "$PROC_TYPE" != "web" ]]; then
echo "$PLUGIN_AVAILABLE_PATH/scheduler-docker-local/bin/scheduler-deploy-process $APP $IMAGE_SOURCE_TYPE $IMAGE $IMAGE_TAG $PROC_TYPE $PROC_COUNT" >>"$TMP_FILE"
continue