Class: DPL::Provider::Deis

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

Instance Attribute Summary

Attributes inherited from DPL::Provider

#context, #options

Instance Method Summary collapse

Methods inherited from DPL::Provider

apt_get, #cleanup, #commit_msg, context, #create_key, #deploy, #detect_encoding?, #encoding_for, #error, experimental, #initialize, #log, new, npm_g, #option, pip, requires, #setup_git_credentials, #sha, shell, #uncleanup, #warn

Constructor Details

This class inherits a constructor from DPL::Provider

Instance Method Details

#check_appObject



19
20
21
22
23
# File 'lib/dpl/provider/deis.rb', line 19

def check_app
  unless context.shell "deis apps:info --app=#{option(:app)}"
    error 'Application could not be verified.'
  end
end

#check_authObject



11
12
13
14
15
16
17
# File 'lib/dpl/provider/deis.rb', line 11

def check_auth
  unless context.shell "deis login #{controller_url}" \
                " --username=#{option(:username)}" \
                " --password=#{option(:password)}"
    error 'Login failed.'
  end
end

#needs_key?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/dpl/provider/deis.rb', line 7

def needs_key?
  true
end

#push_appObject



48
49
50
51
52
53
# File 'lib/dpl/provider/deis.rb', line 48

def push_app
  wait_until_key_is_set
  unless context.shell "git push #{git_push_url} HEAD:refs/heads/master -f"
    error 'Deploying application failed.'
  end
end

#remove_keyObject



42
43
44
45
46
# File 'lib/dpl/provider/deis.rb', line 42

def remove_key
  unless context.shell "deis keys:remove #{option(:key_name)}"
    error 'Removing keys failed.'
  end
end

#run(command) ⇒ Object



55
56
57
58
59
# File 'lib/dpl/provider/deis.rb', line 55

def run(command)
  unless context.shell "deis apps:run #{command}"
    error 'Running command failed.'
  end
end

#setup_git_ssh(path, key_path) ⇒ Object



31
32
33
34
35
36
37
38
39
40
# File 'lib/dpl/provider/deis.rb', line 31

def setup_git_ssh(path, key_path)
  super(path, key_path)
  # Deis uses a non-standard port, so we need to create a
  # ssh config shortcut
  key_path = File.expand_path(key_path)
  add_ssh_config_entry(key_path)
  # A git remote is required for running commands
  # https://github.com/deis/deis/issues/1086
  add_git_remote
end

#setup_key(file) ⇒ Object



25
26
27
28
29
# File 'lib/dpl/provider/deis.rb', line 25

def setup_key(file)
  unless context.shell "deis keys:add #{file}"
    error 'Adding keys failed.'
  end
end