Class: DeployGate::Deploy
- Inherits:
-
Object
- Object
- DeployGate::Deploy
- Defined in:
- lib/deploygate/deploy.rb
Defined Under Namespace
Classes: NotFileExistError, NotLoginError, UploadError
Class Method Summary collapse
Class Method Details
.push(command, file_path, target_user, message, distribution_key, disable_notify = false) { ... } ⇒ Hash
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/deploygate/deploy.rb', line 20 def push(command, file_path, target_user, , distribution_key, disable_notify = false, &process_block) raise NotFileExistError, 'Target file is not found' if file_path.nil? || !File.exist?(file_path) session = DeployGate::Session.new() raise NotLoginError, 'Must login user' unless session.login? token = session.token data = API::V1::Push.upload(command, file_path, target_user, token, , distribution_key || '', disable_notify) { process_block.call unless process_block.nil? } raise UploadError, data[:message] if data[:error] data end |