class DPL::Provider::Anynines

Public Instance Methods

app_name() click to toggle source
# File lib/dpl/provider/anynines.rb, line 44
def app_name
  options[:app_name].nil? ? "" : " '#{options[:app_name]}'"
end
check_app() click to toggle source
# File lib/dpl/provider/anynines.rb, line 21
def check_app
  if options[:manifest]
    error 'Application must have a manifest.yml for unattended deployment' unless File.exists? options[:manifest]
  end
end
check_auth() click to toggle source
# File lib/dpl/provider/anynines.rb, line 15
def check_auth
  initial_go_tools_install
  context.shell "./cf api https://api.aws.ie.a9s.eu"
  context.shell "./cf login -u #{option(:username)} -p #{option(:password)} -o #{option(:organization)} -s #{option(:space)}"
end
cleanup() click to toggle source
# File lib/dpl/provider/anynines.rb, line 38
def cleanup
end
initial_go_tools_install() click to toggle source

NOTE: Much of this class is duplicated from CloudFoundry. This is by design. By duplicating a manageable amount of code here, we prevent this provider and its gem `dpl-anynines` from having a dependency on `dpl-cloudfoundry`. Having less dependency is desirable when we install this gem from source.

# File lib/dpl/provider/anynines.rb, line 11
def initial_go_tools_install
  context.shell 'test $(uname) = "Linux" && rel="linux64-binary" || rel="macosx64"; wget "https://cli.run.pivotal.io/stable?release=${rel}&source=github" -qO cf.tgz && tar -zxvf cf.tgz && rm cf.tgz'
end
manifest() click to toggle source
# File lib/dpl/provider/anynines.rb, line 48
def manifest
  options[:manifest].nil? ? "" : " -f #{options[:manifest]}"
end
needs_key?() click to toggle source
# File lib/dpl/provider/anynines.rb, line 27
def needs_key?
  false
end
push_app() click to toggle source
# File lib/dpl/provider/anynines.rb, line 31
def push_app
  error 'Failed to push app' unless context.shell("./cf push#{app_name}#{manifest}")

ensure
  context.shell "./cf logout"
end
uncleanup() click to toggle source
# File lib/dpl/provider/anynines.rb, line 41
def uncleanup
end