refactor: setup app domains in the post-create hook

This is more consistent with app setup, at the cost of making it so developers must disable domains manually afterwards.
This commit is contained in:
Jose Diaz-Gonzalez
2022-12-01 21:47:59 -05:00
parent 1fab98286b
commit 9eab17af11
6 changed files with 5 additions and 26 deletions

View File

@@ -12,3 +12,4 @@
- The `DOKKU_WAIT_TO_RETIRE` environment variable has been migrated to a `checks` property named `wait-to-retire` and will be ignored if set as an environment variable.
- The `Procfile` is now extracted when source code is extracted for a build and not from the built image. Users can specify alternative paths via the `procfile-path` property of the `ps` plugin. See the [process management documentation](/docs/processes/process-management.md#changing-the-procfile-location) for more information on how to configure the `Procfile` path for your application.
- The `domains-setup` trigger has been removed. Initial app domains will now be automatically setup during app creation.

View File

@@ -713,21 +713,6 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# TODO
```
### `domains-setup`
- Description: Initializes domains for an app if enabled
- Invoked by:
- Arguments: `$APP`
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# TODO
```
### `domains-vhost-enabled`
- Description: Checks if a virtual hosts are enabled for an app

View File

@@ -30,9 +30,6 @@ trigger-caddy-vhosts-docker-args-process-deploy() {
return
fi
# run this silently or the output will be set as a label
plugn trigger domains-setup "$APP" >/dev/null
# ensure we have a port mapping
plugn trigger proxy-configure-ports "$APP"

View File

@@ -3,17 +3,17 @@ source "$PLUGIN_AVAILABLE_PATH/domains/functions"
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
trigger-domains-domains-setup() {
trigger-domains-post-create() {
declare desc="creates vhost files as necessary"
declare trigger="domains-setup"
declare trigger="post-create"
declare APP="$1"
if [[ "$(is_app_vhost_enabled "$APP")" == "false" ]]; then
dokku_log_info1 "App virtual host support disabled, skipping domains setup"
dokku_log_info1 "App virtual host support disabled, skipping domain setup"
return
fi
domains_setup "$APP"
}
trigger-domains-domains-setup "$@"
trigger-domains-post-create "$@"

View File

@@ -16,7 +16,6 @@ trigger-nginx-vhosts-proxy-build-config() {
HAS_NETWORK_CONFIG="$(plugn trigger network-config-exists "$APP")"
if [[ "$HAS_NETWORK_CONFIG" == "true" ]]; then
plugn trigger domains-setup "$APP"
plugn trigger network-build-config "$APP"
nginx_build_config "$APP"
if [[ -f "${DOKKU_LIB_ROOT}/data/nginx-vhosts/app-$APP/nginx.conf.sigil.$DOKKU_PID" ]]; then

View File

@@ -30,9 +30,6 @@ trigger-traefik-vhosts-docker-args-process-deploy() {
return
fi
# run this silently or the output will be set as a label
plugn trigger domains-setup "$APP" >/dev/null
# ensure we have a port mapping
plugn trigger proxy-configure-ports "$APP"