mirror of
https://github.com/dokku/dokku.git
synced 2026-05-18 13:15:19 +02:00
When nginx is stopped (e.g. during traefik/caddy tests), the post-create trigger should not attempt to build and reload the nginx config as the service is not running.
26 lines
631 B
Bash
Executable File
26 lines
631 B
Bash
Executable File
#!/usr/bin/env bash
|
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions"
|
|
source "$PLUGIN_AVAILABLE_PATH/nginx-vhosts/functions"
|
|
set -eo pipefail
|
|
[[ $DOKKU_TRACE ]] && set -x
|
|
|
|
trigger-nginx-vhosts-post-create() {
|
|
declare desc="nginx-vhosts post-create trigger"
|
|
declare trigger="post-create"
|
|
declare APP="$1"
|
|
|
|
fn-plugin-property-setup-app "nginx" "$APP"
|
|
|
|
if [[ "$(plugn trigger proxy-type "$APP")" != "nginx" ]]; then
|
|
return
|
|
fi
|
|
|
|
if [[ "$(fn-plugin-property-get "nginx" "--global" "proxy-status")" == "stopped" ]]; then
|
|
return
|
|
fi
|
|
|
|
nginx_build_config "$APP"
|
|
}
|
|
|
|
trigger-nginx-vhosts-post-create "$@"
|