feat: avoid deprecated functions
This commit is contained in:
@@ -58,3 +58,7 @@ The following changes on the `apps:report` command were made in this release
|
||||
- `nginx:show-conf` has been deprecated in favor of `nginx:show-config`.
|
||||
- `proxy#is_app_proxy_enabled()` is deprecated in favor of `plugn trigger proxy-is-enabled`
|
||||
- `proxy#get_app_proxy_type()` is deprecated in favor of `plugn trigger proxy-type`
|
||||
- `apps#apps_create()` is deprecated in favor of `plugn trigger app-create`
|
||||
- `apps#apps_destroy()` is deprecated in favor of `plugn trigger app-destroy`
|
||||
- `apps#apps_exists()` is deprecated in favor of `plugn trigger app-exists`
|
||||
- `apps#apps_maybe_create()` is deprecated in favor of `plugn trigger app-maybe-create`
|
||||
|
||||
@@ -29,6 +29,66 @@ The following plugin triggers describe those available to a Dokku installation.
|
||||
|
||||
> The example plugin trigger code is not guaranteed to be implemented as in within dokku, and are merely simplified examples. Please look at the Dokku source for larger, more in-depth examples.
|
||||
|
||||
### `app-create`
|
||||
|
||||
- Description: Creates an app
|
||||
- Invoked by:
|
||||
- Arguments: `$APP`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `app-destroy`
|
||||
|
||||
- Description: Destroys an app (with confirmation if force isn't specified)
|
||||
- Invoked by:
|
||||
- Arguments: `$APP`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `app-exists`
|
||||
|
||||
- Description: Creates an app
|
||||
- Invoked by:
|
||||
- Arguments: `$APP`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `app-maybe-create`
|
||||
|
||||
- Description: Creates an app (gated by whether this is globally enabled or not)
|
||||
- Invoked by:
|
||||
- Arguments: `$APP`
|
||||
- Example:
|
||||
|
||||
```shell
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
|
||||
# TODO
|
||||
```
|
||||
|
||||
### `app-restart`
|
||||
|
||||
- Description: Triggers an app restart
|
||||
|
||||
1
plugins/20_events/app-create
Symbolic link
1
plugins/20_events/app-create
Symbolic link
@@ -0,0 +1 @@
|
||||
hook
|
||||
1
plugins/20_events/app-destroy
Symbolic link
1
plugins/20_events/app-destroy
Symbolic link
@@ -0,0 +1 @@
|
||||
hook
|
||||
1
plugins/20_events/app-exists
Symbolic link
1
plugins/20_events/app-exists
Symbolic link
@@ -0,0 +1 @@
|
||||
hook
|
||||
1
plugins/20_events/app-maybe-create
Symbolic link
1
plugins/20_events/app-maybe-create
Symbolic link
@@ -0,0 +1 @@
|
||||
hook
|
||||
@@ -38,7 +38,7 @@ git_build_app_repo() {
|
||||
chmod 755 "$GIT_BUILD_APP_REPO_TMP_WORK_DIR"
|
||||
unset GIT_DIR GIT_WORK_TREE
|
||||
|
||||
! apps_exists "$APP" >/dev/null 2>&1 && apps_maybe_create "$APP"
|
||||
! plugn trigger app-exists "$APP" >/dev/null 2>&1 && plugn trigger app-maybe-create "$APP"
|
||||
|
||||
if use_git_worktree; then
|
||||
# git worktree - this method uses git worktree which was introduced in git 2.5
|
||||
@@ -205,7 +205,7 @@ cmd-git-upload-pack() {
|
||||
|
||||
APP="$(echo "$APP" | perl -pe 's/(?<!\\)'\''//g' | sed 's/\\'\''/'\''/g' | sed 's/^\///g')"
|
||||
is_valid_app_name "$APP"
|
||||
! apps_exists "$APP" >/dev/null 2>&1 && apps_maybe_create "$APP"
|
||||
! plugn trigger app-exists "$APP" >/dev/null 2>&1 && plugn trigger app-maybe-create "$APP"
|
||||
|
||||
plugn trigger git-pre-pull "$APP"
|
||||
cat | git-upload-pack "$DOKKU_ROOT/$APP"
|
||||
@@ -220,7 +220,7 @@ cmd-git-glob() {
|
||||
is_valid_app_name "$APP"
|
||||
|
||||
if [[ $1 == "git-receive-pack" && ! -d "$APP_PATH/refs" ]]; then
|
||||
! apps_exists "$APP" >/dev/null 2>&1 && apps_maybe_create "$APP"
|
||||
! plugn trigger app-exists "$APP" >/dev/null 2>&1 && plugn trigger app-maybe-create "$APP"
|
||||
|
||||
fn-git-create-hook "$APP"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user