Aliases are defined in the configuration file under the `aliases` key. The configuration is a map of alias name to command. When we run the command the we just do a literal replacement of the alias with the string. So if we have: ```yaml aliases: console: app exec -r console -i --reuse "rails console" ``` Then running `kamal console -r workers` will run the command ```sh $ kamal app exec -r console -i --reuse "rails console" -r workers ``` Because of the order Thor parses the arguments, this allows us to override the role from the alias command. There might be cases where we need to munge the command a bit more but that would involve getting into Thor command parsing internals, which are complicated and possibly subject to change. There's a chance that your aliases could conflict with future built-in commands, but there's not likely to be many of those and if it happens you'll get a validation error when you upgrade. Thanks to @dhnaranjo for the idea!
29 lines
1.1 KiB
Ruby
29 lines
1.1 KiB
Ruby
require_relative "lib/kamal/version"
|
|
|
|
Gem::Specification.new do |spec|
|
|
spec.name = "kamal"
|
|
spec.version = Kamal::VERSION
|
|
spec.authors = [ "David Heinemeier Hansson" ]
|
|
spec.email = "dhh@hey.com"
|
|
spec.homepage = "https://github.com/basecamp/kamal"
|
|
spec.summary = "Deploy web apps in containers to servers running Docker with zero downtime."
|
|
spec.license = "MIT"
|
|
spec.files = Dir["lib/**/*", "MIT-LICENSE", "README.md"]
|
|
spec.executables = %w[ kamal ]
|
|
|
|
spec.add_dependency "activesupport", ">= 7.0"
|
|
spec.add_dependency "sshkit", ">= 1.23.0", "< 2.0"
|
|
spec.add_dependency "net-ssh", "~> 7.0"
|
|
spec.add_dependency "thor", "~> 1.3"
|
|
spec.add_dependency "dotenv", "~> 2.8"
|
|
spec.add_dependency "zeitwerk", "~> 2.5"
|
|
spec.add_dependency "ed25519", "~> 1.2"
|
|
spec.add_dependency "bcrypt_pbkdf", "~> 1.0"
|
|
spec.add_dependency "concurrent-ruby", "~> 1.2"
|
|
spec.add_dependency "base64", "~> 0.2"
|
|
|
|
spec.add_development_dependency "debug"
|
|
spec.add_development_dependency "mocha"
|
|
spec.add_development_dependency "railties"
|
|
end
|