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

feat: Add destinations command #442

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
coverage/*
.DS_Store
gemfiles/*.lock

.idea/
Zeko369 marked this conversation as resolved.
Show resolved Hide resolved
13 changes: 13 additions & 0 deletions lib/kamal/cli/main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ def setup
end
end

desc 'destinations', 'List available destinations'
option :json, alias: '-j', type: :boolean, default: false, desc: 'Output as JSON'
def destinations
Zeko369 marked this conversation as resolved.
Show resolved Hide resolved
pattern = options[:config_file].gsub(/deploy\.yml/, 'deploy.*.yml')
list = Dir.glob(pattern).map { |f| File.basename(f, '.yml.erb').gsub(/^deploy\./, '') }

if options[:json]
puts list.to_json
else
puts list
end
end

desc "deploy", "Deploy app to servers"
option :skip_push, aliases: "-P", type: :boolean, default: false, desc: "Skip image build and push"
def deploy
Expand Down