Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Preserve kamal default options #1427

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ShPakvel
Copy link
Contributor

Summary

This PR adds .kamal/options.yml file as storage for default options used with kamal commands.

It implements proposal-issue to set default deploy config file with different location. To eliminate necessity applying option with each kamal command, like kamal deploy -c .kamal/deploy.yml, or with often run manually alias-commands.

Closes #1424

This foundation should be easily applicable for other options. E.g. to allow destination default from .kamal/options.yml file, change should be as minimal as following:

-            destination: options[:destination],
+            destination: option_with_default_from_file(:destination),

Changes

  • Add check for default options from .kamal/options.yml file.
  • Add config_file option check, with backward-compatible fallback to config/deploy.yml value.
  • Add .kamal/options.yml creation on kamal init command. Existing option -c can be used during initialization to provide default config file. It will be stored into .kamal/options.yml. If not provided, backward-compatible config/deploy.yml will be stored.
  • Cover .kamal/options.yml with tests.

Note: This PR preserves backward-compatibility with current behavior. This feature is extension without breaking stuff.

- Add check for default options from `.kamal/options.yml` file.
- Add `config_file` option check, with backward-compatible fallback to `config/deploy.yml` value.
- Add `.kamal/options.yml` creation on `kamal init` command. Existing option `-c` can be used during initialization to provide default config file. It will be stored into `.kamal/options.yml`. If not provided, backward-compatible `config/deploy.yml` will be stored.
- Cover `.kamal/options.yml` with tests.

Note: Changes preserve backward-compatibility with current behavior. This feature is extension without breaking stuff.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set default deploy config on kamal init.
1 participant