Class: DPL::Provider::Launchpad

Inherits:
DPL::Provider show all
Defined in:
lib/dpl/provider/launchpad.rb

Instance Attribute Summary

Attributes inherited from DPL::Provider

#context, #options

Instance Method Summary collapse

Methods inherited from DPL::Provider

apt_get, #check_app, #cleanup, #commit_msg, context, #create_key, #default_text_charset, #default_text_charset?, #deploy, deprecated, #detect_encoding?, #encoding_for, #error, experimental, #log, new, npm_g, #option, pip, requires, #run, #setup_git_credentials, #setup_git_ssh, #sha, shell, #uncleanup, #user_agent, #warn

Constructor Details

#initialize(context, options) ⇒ Launchpad

Returns a new instance of Launchpad.



8
9
10
11
12
# File 'lib/dpl/provider/launchpad.rb', line 8

def initialize(context, options)
  super
  @http = Net::HTTP.new('api.launchpad.net', 443)
  @http.use_ssl = true
end

Instance Method Details

#check_authObject



14
15
# File 'lib/dpl/provider/launchpad.rb', line 14

def check_auth
end

#needs_key?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/dpl/provider/launchpad.rb', line 17

def needs_key?
  false
end

#push_appObject



21
22
23
24
25
# File 'lib/dpl/provider/launchpad.rb', line 21

def push_app
  response = api_call('/1.0/' + options[:slug] + '/+code-import', {'ws.op' => 'requestImport'})
  error('Deploy failed! Launchpad credentials invalid. ' + response.code.to_s) if response.code == '401'
  error('Error: ' + response.code.to_s + ' ' + response.body) unless response.kind_of? Net::HTTPSuccess
end