Merge pull request #2489 from stackforgehq/feature/plugin-uninstall-trigger
add plugin uninstall trigger
This commit is contained in:
@@ -866,6 +866,26 @@ APP="$1"; IMAGE_TAG="$2"
|
|||||||
some code to remove a docker hub tag because it's not implemented in the CLI....
|
some code to remove a docker hub tag because it's not implemented in the CLI....
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### `uninstall`
|
||||||
|
|
||||||
|
- Description: Used to cleanup after itself.
|
||||||
|
- Invoked by: `dokku plugin:uninstall`
|
||||||
|
- Arguments: `$PLUGIN`
|
||||||
|
- Example:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
# Cleanup up extra containers created
|
||||||
|
|
||||||
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
|
PLUGIN="$1"
|
||||||
|
|
||||||
|
[[ "$PLUGIN" = "my-plugin" ]] && docker rmi -f "${PLUGIN_IMAGE_DEPENDENCY}"
|
||||||
|
```
|
||||||
|
|
||||||
|
> To avoid uninstalling other plugins make sure to check the plugin name like shown in the example.
|
||||||
|
|
||||||
### `update`
|
### `update`
|
||||||
|
|
||||||
- Description: Can be used to run plugin updates on a regular interval. You can schedule the invoker in a cron-task to ensure your system gets regular updates.
|
- Description: Can be used to run plugin updates on a regular interval. You can schedule the invoker in a cron-task to ensure your system gets regular updates.
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ uninstall_plugin() {
|
|||||||
local PLUGIN="$1"
|
local PLUGIN="$1"
|
||||||
[[ -e $PLUGIN_CORE_AVAILABLE_PATH/$PLUGIN ]] && dokku_log_fail "Cannot uninstall a core plugin"
|
[[ -e $PLUGIN_CORE_AVAILABLE_PATH/$PLUGIN ]] && dokku_log_fail "Cannot uninstall a core plugin"
|
||||||
[[ ! -e $PLUGIN_AVAILABLE_PATH/$PLUGIN ]] && dokku_log_fail "Plugin ($PLUGIN) is not currently installed"
|
[[ ! -e $PLUGIN_AVAILABLE_PATH/$PLUGIN ]] && dokku_log_fail "Plugin ($PLUGIN) is not currently installed"
|
||||||
|
plugn trigger uninstall "$PLUGIN"
|
||||||
plugn uninstall "$PLUGIN"
|
plugn uninstall "$PLUGIN"
|
||||||
dokku_log_info1_quiet "Plugin $PLUGIN uninstalled"
|
dokku_log_info1_quiet "Plugin $PLUGIN uninstalled"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user