Class: DPL::Provider::Anynines
- Inherits:
-
DPL::Provider
- Object
- DPL::Provider
- DPL::Provider::Anynines
- Defined in:
- lib/dpl/provider/anynines.rb
Instance Method Summary collapse
- #app_name ⇒ Object
- #check_app ⇒ Object
- #check_auth ⇒ Object
- #cleanup ⇒ Object
-
#initial_go_tools_install ⇒ Object
NOTE: Much of this class is duplicated from CloudFoundry.
- #manifest ⇒ Object
- #needs_key? ⇒ Boolean
- #push_app ⇒ Object
- #uncleanup ⇒ Object
Instance Method Details
#app_name ⇒ Object
44 45 46 |
# File 'lib/dpl/provider/anynines.rb', line 44 def app_name [:app_name].nil? ? "" : " '#{[:app_name]}'" end |
#check_app ⇒ Object
21 22 23 24 25 |
# File 'lib/dpl/provider/anynines.rb', line 21 def check_app if [:manifest] error 'Application must have a manifest.yml for unattended deployment' unless File.exists? [:manifest] end end |
#check_auth ⇒ Object
15 16 17 18 19 |
# 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 ⇒ Object
38 39 |
# File 'lib/dpl/provider/anynines.rb', line 38 def cleanup end |
#initial_go_tools_install ⇒ Object
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.
11 12 13 |
# 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 ⇒ Object
48 49 50 |
# File 'lib/dpl/provider/anynines.rb', line 48 def manifest [:manifest].nil? ? "" : " -f #{[:manifest]}" end |
#needs_key? ⇒ Boolean
27 28 29 |
# File 'lib/dpl/provider/anynines.rb', line 27 def needs_key? false end |
#push_app ⇒ Object
31 32 33 34 35 36 |
# 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 ⇒ Object
41 42 |
# File 'lib/dpl/provider/anynines.rb', line 41 def uncleanup end |