lib/gisha/cli.rb in gisha-0.0.10 vs lib/gisha/cli.rb in gisha-0.1.0
- old
+ new
@@ -12,51 +12,11 @@
def execute
Commands::Receive.new(key_id).exec
end
end
- class AddKeyCommand < Clamp::Command
- parameter 'ID', 'id to identify the key'
- parameter 'KEY', 'public key that was provided to the server'
- parameter 'AUTH_FILE', 'file containing public keys for public key authentication'
- def execute
- Commands::Key.new(auth_file, id, key).add
- end
-
- end
-
- class DeleleteKeyCommand < Clamp::Command
- parameter 'ID', 'id to identify the key'
- parameter 'AUTH_FILE', 'file containing public keys for public key authentication;'
-
- def execute
- Commands::Key.new(auth_file, id).del
- end
- end
-
- class CreateRepositoryCommand < Clamp::Command
- parameter 'PATH', 'path to create repository'
-
- def execute
- Rugged::Repository.init_at(path, :bare)
- FileUtils.cp("#{root_path}/hooks/update", "#{path}/hooks")
- end
-
- def root_path
- @root_path ||= File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
- end
- end
-
- class DeleteRepositoryCommand < Clamp::Command
- parameter 'PATH', 'path to delete repository'
-
- def execute
- FileUtils.rm_rf(path)
- end
- end
-
class DeployCommand < Clamp::Command
parameter 'URL', 'url to deploy'
parameter 'KEY_ID', 'id to identify the key'
parameter 'PATH', 'repository path'
parameter 'REVISION', 'repository path'
@@ -65,15 +25,9 @@
Commands::Deploy.new(url, key_id, path, revision).exec
end
end
class CLI < Clamp::Command
- subcommand 'keys:add', 'add new key', AddKeyCommand
- subcommand 'keys:del', 'delete key', DeleleteKeyCommand
-
- subcommand 'repositories:create', 'create repository', CreateRepositoryCommand
- subcommand 'repositories:delete', 'delete repository', DeleteRepositoryCommand
-
subcommand 'receive', 'receive what is pushed into the repository', ReceiveCommand
subcommand 'deploy', 'deploy to spass', DeployCommand
end
end