Class: Danger::DangerDeploygate

Inherits:
Plugin
  • Object
show all
Defined in:
lib/deploygate/plugin.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#tokenObject



20
21
22
# File 'lib/deploygate/plugin.rb', line 20

def token
  @token ||= ENV['DEPLOYGATE_API_TOKEN']
end

#userString

Uploading user or group name

Returns:

  • (String)


11
12
13
# File 'lib/deploygate/plugin.rb', line 11

def user
  @user
end

Instance Method Details

#upload(binary, filename, message = nil, distribution_name = nil) ⇒ Object



24
25
26
27
28
29
30
31
32
33
# File 'lib/deploygate/plugin.rb', line 24

def upload(binary, filename, message = nil, distribution_name = nil)
  client = DeployGate::Client.new(user, token)
  response = client.upload(binary, filename, message, distribution_name)

  app_name = response['results']['name']
  revision = "#{response['results']['revision']}"
  url = "https://deploygate.com#{response['results']['path']}"

  message "DeployGate Uploaded #{app_name} #{revision}, see detail: #{url}"
end