Class: DPL::Provider::CloudFoundry
- Inherits:
-
DPL::Provider
- Object
- DPL::Provider
- DPL::Provider::CloudFoundry
- Defined in:
- lib/dpl/provider/cloud_foundry.rb
Instance Method Summary collapse
- #app_name ⇒ Object
- #check_app ⇒ Object
- #check_auth ⇒ Object
- #cleanup ⇒ Object
- #initial_go_tools_install ⇒ Object
- #manifest ⇒ Object
- #needs_key? ⇒ Boolean
- #push_app ⇒ Object
- #uncleanup ⇒ Object
Instance Method Details
#app_name ⇒ Object
38 39 40 |
# File 'lib/dpl/provider/cloud_foundry.rb', line 38 def app_name [:app_name].nil? ? "" : " '#{[:app_name]}'" end |
#check_app ⇒ Object
15 16 17 18 19 |
# File 'lib/dpl/provider/cloud_foundry.rb', line 15 def check_app if [:manifest] error 'Application must have a manifest.yml for unattended deployment' unless File.exists? [:manifest] end end |
#check_auth ⇒ Object
9 10 11 12 13 |
# File 'lib/dpl/provider/cloud_foundry.rb', line 9 def check_auth initial_go_tools_install context.shell "./cf api #{option(:api)} #{'--skip-ssl-validation' if [:skip_ssl_validation]}" [:client_id] ? check_client_auth : check_basic_auth end |
#cleanup ⇒ Object
32 33 |
# File 'lib/dpl/provider/cloud_foundry.rb', line 32 def cleanup end |
#initial_go_tools_install ⇒ Object
5 6 7 |
# File 'lib/dpl/provider/cloud_foundry.rb', line 5 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 ⇒ Object
42 43 44 |
# File 'lib/dpl/provider/cloud_foundry.rb', line 42 def manifest [:manifest].nil? ? "" : " -f #{[:manifest]}" end |
#needs_key? ⇒ Boolean
21 22 23 |
# File 'lib/dpl/provider/cloud_foundry.rb', line 21 def needs_key? false end |
#push_app ⇒ Object
25 26 27 28 29 30 |
# File 'lib/dpl/provider/cloud_foundry.rb', line 25 def push_app error 'Failed to push app' unless context.shell("./cf push#{app_name}#{manifest}") ensure context.shell "./cf logout" end |
#uncleanup ⇒ Object
35 36 |
# File 'lib/dpl/provider/cloud_foundry.rb', line 35 def uncleanup end |