19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/deploygate/deploy.rb', line 19
def push(file_path, target_user, message, 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(file_path, target_user, token, message, distribution_key || '', disable_notify) { process_block.call unless process_block.nil? }
raise UploadError, data[:message] if data[:error]
data
end
|