Class: DPL::Provider::Openshift
Instance Attribute Summary
#context, #options
Instance Method Summary
collapse
#cleanup, context, #create_key, #deploy, #error, experimental, #initialize, #log, #needs_key?, new, npm_g, #option, pip, requires, #run, #setup_git_credentials, #setup_git_ssh, #sha, shell, #uncleanup
Constructor Details
This class inherits a constructor from DPL::Provider
Instance Method Details
#api ⇒ Object
6
7
8
|
# File 'lib/dpl/provider/openshift.rb', line 6
def api
@api ||= ::RHC::Rest::Client.new(:user => option(:user), :password => option(:password), :server => 'openshift.redhat.com')
end
|
#app ⇒ Object
14
15
16
|
# File 'lib/dpl/provider/openshift.rb', line 14
def app
@app ||= api.find_application(option(:domain), option(:app))
end
|
#check_app ⇒ Object
22
23
24
|
# File 'lib/dpl/provider/openshift.rb', line 22
def check_app
log "found app #{app.name}"
end
|
#check_auth ⇒ Object
18
19
20
|
# File 'lib/dpl/provider/openshift.rb', line 18
def check_auth
log "authenticated as %s" % user
end
|
#push_app ⇒ Object
35
36
37
|
# File 'lib/dpl/provider/openshift.rb', line 35
def push_app
context.shell "git push #{app.git_url} -f"
end
|
#remove_key ⇒ Object
31
32
33
|
# File 'lib/dpl/provider/openshift.rb', line 31
def remove_key
api.delete_key(option(:key_name))
end
|
#restart ⇒ Object
39
40
41
|
# File 'lib/dpl/provider/openshift.rb', line 39
def restart
app.restart
end
|
#setup_key(file, type = nil) ⇒ Object
26
27
28
29
|
# File 'lib/dpl/provider/openshift.rb', line 26
def setup_key(file, type = nil)
specified_type, content, = File.read(file).split
api.add_key(option(:key_name), content, type || specified_type)
end
|
#user ⇒ Object
10
11
12
|
# File 'lib/dpl/provider/openshift.rb', line 10
def user
@user ||= api.user.login
end
|