Skip to content

Add --push-secrets option to exec for pushing .env files#1742

Open
anatoly-pashin-axon21 wants to merge 3 commits intobasecamp:mainfrom
anatoly-pashin-axon21:push-secrets
Open

Add --push-secrets option to exec for pushing .env files#1742
anatoly-pashin-axon21 wants to merge 3 commits intobasecamp:mainfrom
anatoly-pashin-axon21:push-secrets

Conversation

@anatoly-pashin-axon21
Copy link
Copy Markdown

@anatoly-pashin-axon21 anatoly-pashin-axon21 commented Dec 30, 2025

This is meant to replace #1223: as it was mentioned in the discussion, a flag might be a better option.

@anatoly-pashin-axon21 anatoly-pashin-axon21 changed the title Add --push-secrets option to exec command for pushing environment… Add --push-secrets option to exec for pushing .env files Dec 30, 2025
@djmb
Copy link
Copy Markdown
Collaborator

djmb commented Jan 23, 2026

Thanks for the PR @anatoly-pashin-axon21.

I think we need a couple of changes here:

  1. We should also allow --push_secrets for the interactive app exec.
  2. We should raise an exception if --push_secrets is combined with --reuse

@anatoly-pashin-axon21
Copy link
Copy Markdown
Author

@djmb the comments are addressed, please review again

Copilot AI review requested due to automatic review settings March 27, 2026 03:37
@anatoly-pashin-axon21
Copy link
Copy Markdown
Author

anatoly-pashin-axon21 commented Mar 27, 2026

Hi @djmb, is there anything I can do to help get this included in a release?

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an opt-in --push-secrets flag to kamal app exec so operators can push the role env files to target servers immediately before running an exec command, ensuring secrets are available in the ephemeral container when needed.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Changes:

  • Add --push-secrets boolean option to kamal app exec that uploads role env files before running docker run.
  • Reject the unsupported combination --push-secrets + --reuse.
  • Add CLI tests covering --push-secrets behavior for normal, primary-only, interactive, and incompatible --reuse usage.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
lib/kamal/cli/app.rb Implements --push-secrets flag and env-file upload flow (and blocks it with --reuse).
test/cli/app_test.rb Adds coverage for exec with/without --push-secrets, including interactive mode and the --reuse incompatibility.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

3 participants