Merge pull request #9049 from dokku/9043-config-set-reports-success-even-when-writing-the-env-file-fails

Report config write failures instead of exiting 0
This commit is contained in:
Jose Diaz-Gonzalez authored and GitHub committed 2026-09-18 04:08:19 -04:00
commit be4689e771
10 files changed
+399 -111

No files matched your search

@@ -55,6 +55,8 @@ For multi-line values from a file (such as an SSH private key), `cat` and `base6
dokku config:set --encoded node-js-app KEY="$(cat ~/.ssh/id_rsa | base64 -w 0)"
```
If the environment cannot be written to disk, `config:set`, `config:unset` and `config:clear` report the failure and exit non-zero without restarting the application. The previous environment is left intact, so the command can be retried once the underlying problem - a full disk or the wrong permissions on `$DOKKU_LIB_ROOT/config/<app>` being the usual causes - has been dealt with.
When setting or unsetting environment variables, you may wish to avoid an application restart. This is useful when developing plugins or when setting multiple environment variables in a scripted manner. To do so, use the `--no-restart` flag:
```shell
+16 -1
View File
@@ -598,7 +598,7 @@ plugn trigger config-migrate-env
### `config-set`
- Description: Sets one or more config values for an app without restarting (when --no-restart flag is specified)
- Description: Sets one or more config values for an app without restarting (when --no-restart flag is specified). Exits non-zero without restarting the app when the config cannot be persisted.
- Invoked by: app-json plugin
- Arguments: `[--no-restart] $APP $KEY1=VALUE1 [$KEY2=VALUE2 ...]`
- Example:
@@ -611,6 +611,21 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
# TODO
```
### `config-unset`
- Description: Unsets a single config value for an app. Exits non-zero without restarting the app when the config cannot be persisted.
- Invoked by: `common` when migrating deprecated config vars to plugin properties
- Arguments: `$APP $KEY $RESTART`, or `--global $KEY $RESTART` when the `--global` flag is given
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
plugn trigger config-unset node-js-app DEPRECATED_VAR false
```
### `core-post-deploy`
> To avoid issues with community plugins, this plugin trigger should be used _only_ for core plugins. Please avoid using this trigger in your own plugins.