Commit Graph

64 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
70dc921967 fix: migrate env files before reading deprecated vars
Install steps run in alphabetical order of the enabled plugin directory, so `apps`, `builder`, and `checks` read an app's environment before the `config` plugin had moved the `ENV` file to its new location. The read came back empty, so their deprecated `DOKKU_*` variables were never migrated to the matching plugin property and were never unset, with nothing reported either way: `dokku config:show` kept listing the variable while the plugin behaved as though it were unset. The relocation now runs before any deprecated variable is read, whatever the install order, and each old file is removed as soon as it has been drained rather than on a later install, which also covers the global file that was never removed at all. A file that reappears at the old path can only have been written by hand, so it is merged in with a warning naming its keys instead of being discarded.
2026-08-07 16:43:56 -04:00
Jose Diaz-Gonzalez
f2f6e0b473 refactor: move the env files to the new path on upgrade
Refs #1558
2026-04-27 01:06:29 -04:00
Jose Diaz-Gonzalez
34c336c668 feat: add post-create support for env key in app.json
Closes #4498
2026-04-26 22:43:32 -04:00
Jose Diaz-Gonzalez
d9073272df fix: minor help output formatting 2025-11-16 18:06:56 -05:00
Jose Diaz-Gonzalez
e134c314ea feat: implement config:import command
Closes #6846
2025-11-08 01:02:19 -05:00
Jose Diaz-Gonzalez
758d9f8a83 feat: add config-unset trigger 2025-06-09 11:39:00 -04:00
Jose Diaz-Gonzalez
e0409caf75 fix: ensure env vars are copied over when cloning or renaming an app 2024-03-14 00:26:18 -04:00
Jose Diaz-Gonzalez
fe262a3a3c chore: remove extra trailing newline 2024-02-12 21:43:45 -05:00
Jose Diaz-Gonzalez
3c6cc68086 refactor: capture output by default
This is almost certainly the correct default for Dokku. While it's a BC break and might cause an increase in memory usage, the api is mostly internal and therefore this is safe to use.
2024-02-12 20:28:31 -05:00
Jose Diaz-Gonzalez
047a3c00f5 chore: remove default false values when calling CallExecCommand 2024-02-12 20:07:43 -05:00
Jose Diaz-Gonzalez
50239b056c fix: use new CallExecCommand when checking to see how help is being called
This is part of ongoing work to remove usage of the depreated NewShellCmd.
2024-02-12 00:55:16 -05:00
Jose Diaz-Gonzalez
798a413096 feat: re-add apps and config cli aliases
This better follows Heroku's output and is more useful to users. The subcommands will be treated as the primary, documented versions, while the aliases are there for convenience.

Closes #5362
2023-08-05 10:58:57 -04:00
Jose Diaz-Gonzalez
d243433625 fix: add support for --global as app name when calling config-get trigger
The trigger in use _should_ be config-get-global, but some calling code does not check, so adding support here will ensure the calling code gets what it expects.

Refs #5269
2022-07-29 22:44:23 -04:00
Jose Diaz-Gonzalez
5981ff8e9b refactor: split out config logic to remove need to check app name for function-based usage
This MR splits out the logic such that there is now a binary that handles function based calls without validating the app name. We should only every check the app name for the subcommands and not internally. Internal calls should have their arguments taken at face value.
2022-05-27 23:28:59 -04:00
Jose Diaz-Gonzalez
5b7464f525 refactor: use new name for pack format 2022-01-15 08:39:53 -05:00
Jose Diaz-Gonzalez
6f55b89149 refactor: simplify env var passing by using a new config:export format
Also add a test for env vars during build time for pack-built applications.
2022-01-15 08:34:02 -05:00
Jose Diaz-Gonzalez
d55e34a55f refactor: use LogFailWithError to allow a unified exit code for golang commands when the app is missing 2021-02-28 15:20:46 -05:00
Jose Diaz-Gonzalez
d09a7506df refactor: bubble up error handling so that standard exit codes can be set at the top-level
LogFail shouldn't be called internally if at all possible.
2021-02-28 15:20:46 -05:00
Jose Diaz-Gonzalez
0405b36ab4 fix: implement config-export hook
This will allow dropping many of the "source config/functions" calls littered over the codebase. Plugin triggers are the way to perform cross-plugin communication :)
2021-02-11 06:41:11 -05:00
Jose Diaz-Gonzalez
5921692f83 feat: add ability to export env vars as a --env=key ... string 2021-02-11 03:50:51 -05:00
Jose Diaz-Gonzalez
8240790381 fix: correct argument handling when setting the --app flag
When setting the `--app` flag, there was a special case for the config plugin. This plugin used to take the `--no-restart` flag as the first argument - and still did until this change - resulting in an invalid call to the plugin subcommands. What is worse is that this functionality carried over to all other plugins as they were rewritten in golang, and thus the issue spread without us knowing.

The fix is to support GNU flag parsing rules, which Golang does not do by default (Because Of Reasons™). Switching to `github.com/spf13/pflag` fixes this issue, and also allows positional arguments to be placed wherever, even in the middle of flags.

Closes #4255
2020-12-20 22:06:33 -05:00
Jose Diaz-Gonzalez
45e3623ffd refactor: switch to go mod
This hopefully makes it a little easier to work with as the tooling is now based on something in golang core.

- move columnize usage to common plugin
- remove old vendor files
2020-06-28 01:11:28 -04:00
Jose Diaz-Gonzalez
88f661b6e7 fix: properly fetch keys for config command 2020-05-29 14:50:17 -04:00
Jose Diaz-Gonzalez
a0cb7c560e tests: fix issues with fetching config 2020-05-29 04:22:14 -04:00
Jose Diaz-Gonzalez
a93cec63be feat: simplify flag parsing in config plugin
Commands should be written such that they take arguments as is.
2020-05-29 01:59:50 -04:00
Jose Diaz-Gonzalez
aa156b2834 feat: add missing config-get triggers 2020-03-10 18:19:04 -04:00
Jose Diaz-Gonzalez
ef7894fdfa refactor: standardize help generation 2020-02-10 00:37:00 -05:00
Jose Diaz-Gonzalez
6a7d2e5252 refactor: decrease compile time for golang plugins
This change refactors the compiled golang plugins into 3 distinct binaries:

- commands: already existing
- subcommands/subcommands: entrypoint into all subcommands
- triggers: entrypoint into all triggers

It then further symlinks triggers and subcommands to the built binaries. This results in both a much faster build process as well as smaller package size.
2019-09-15 19:15:08 -04:00
Jose Diaz-Gonzalez
f977edabb2 feat: add config:clear command
Closes #3537
2019-05-20 13:26:21 -07:00
Jose Diaz-Gonzalez
04c9fe974e feat: add json output to config:export
This change adds json output as both key/value as well as a list of objects. The former can be used in quick scripting environments, while the latter allows higher-level languages to have a bit more structure around how environment variables are declared. Specifically, systems such as kubernetes understand the latter method, while the former can be used within Nomad job files.
2019-04-21 18:39:06 -04:00
Jose Diaz-Gonzalez
4b63c96434 feat: pre-sort config:help commands 2019-04-21 16:16:39 -04:00
Jose Diaz-Gonzalez
884c45de0c chore: move print calls together 2019-03-05 21:34:26 -05:00
Jose Diaz-Gonzalez
af8718cebe fix: ensure official golang plugins have correct help output
Previously, golang plugins would omit subcommands for 'dokku help --all', meaning they could not be introspected upon by outside tooling.
2019-01-20 22:50:48 -05:00
Kazuhiro NISHIYAMA
c77d323f1f Add --no-restart to config:unset of config:help 2018-05-25 19:50:15 +09:00
Mary Kate Fain
2cfcea3479 Updated help text on config:set to have commands in working order (#3132) 2018-03-27 21:33:03 -05:00
Jose Diaz-Gonzalez
6d43931e17 fix: properly set help output for golang applications
Closes #3007
2018-02-28 03:22:00 -05:00
Raine Virta
a932a421ce Fix typo 2018-02-01 00:21:55 +02:00
Alex Quick
061ea9bfd7 [config] fix help output
* `dokku:help --all` was getting mangled
* `dokku config:help` wasn't working
2017-12-15 10:06:19 -05:00
Jose Diaz-Gonzalez
54d731aeee Merge pull request #2965 from znz/remove-spaces
Remove spaces like helps of other subcommands
2017-11-03 18:07:12 -04:00
Kazuhiro NISHIYAMA
33a540502a Remove spaces like helps of other subcommands 2017-11-03 12:51:40 +09:00
Kazuhiro NISHIYAMA
a3cd6f6e63 Fix typos 2017-11-03 12:42:00 +09:00
Alex Quick
91c2164e49 [config] refactor package structure 2017-10-15 20:10:46 -04:00
Alex Quick
03830562c2 move around the members of configenv to make more sense 2017-10-12 23:49:22 -04:00
Alex Quick
430cc2b4ca [config] move PrettyPrintEnvEntries 2017-10-12 23:42:14 -04:00
Alex Quick
3f497908b5 [config] use named returns where applicable 2017-10-12 23:41:42 -04:00
Alex Quick
3422866909 [config] remove spurious newlines 2017-10-12 22:50:29 -04:00
Alex Quick
5d72f145df [config] restore dokku config functionality and fix docs 2017-10-01 22:50:01 -04:00
Alex Quick
60e3b37d39 [config] trigger app restart through plugn rather than exec 2017-09-27 23:56:43 -04:00
Alex Quick
a86c037a91 [config] upgrade to godotenv 1.2.0 2017-09-27 23:56:42 -04:00
Alex Quick
a13722eec1 [config] update glide dependencies 2017-09-27 23:56:42 -04:00