#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
source "$PLUGIN_AVAILABLE_PATH/scheduler-docker-local/internal-functions"

trigger-scheduler-docker-local-scheduler-retire() {
  declare desc="retires all old containers once they have aged out"
  declare trigger="scheduler-retire"
  declare SCHEDULER="$1" APP="$2"

  fn-scheduler-docker-local-retire-containers "$SCHEDULER" "$APP"
  fn-scheduler-docker-local-retire-images "$SCHEDULER" "$APP"
}

trigger-scheduler-docker-local-scheduler-retire "$@"
