Files
dokku/plugins/scheduler-docker-local/scheduler-is-deployed
Jose Diaz-Gonzalez 5373cf2989 refactor: allow the scheduler to decide if an app is deployed
Without moving this to the scheduler, all applications are assumed to not be deployed unless the scheduler is set to docker-local.

Closes #3531
2019-05-10 17:47:39 -04:00

24 lines
490 B
Bash
Executable File

#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
scheduler-docker-local-scheduler-is-deployed() {
declare desc="checks if an app is deployed"
declare DOKKU_SCHEDULER="$1" APP="$2"
if [[ "$DOKKU_SCHEDULER" != "docker-local" ]]; then
return
fi
if [[ -f "$DOKKU_ROOT/$APP/CONTAINER" ]] || [[ $(
ls "$DOKKU_ROOT/$APP"/CONTAINER.* &>/dev/null
echo $?
) -eq 0 ]]; then
return 0
fi
return 1
}
scheduler-docker-local-scheduler-is-deployed "$@"