Class: DEIS::Destroy
- Includes:
- Thor::Shell
- Defined in:
- lib/rdeis/destroy.rb
Constant Summary
Constants inherited from Storage
Storage::BASE_PATH, Storage::ENV_VAR_PATH
Constants inherited from Base
Instance Attribute Summary collapse
-
#cluster ⇒ Object
Returns the value of attribute cluster.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#options ⇒ Object
Returns the value of attribute options.
-
#output ⇒ Object
Returns the value of attribute output.
-
#path ⇒ Object
Returns the value of attribute path.
-
#proxy ⇒ Object
Returns the value of attribute proxy.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
Attributes inherited from Base
Instance Method Summary collapse
-
#all ⇒ Object
runs everyhing in order.
- #domains ⇒ Object
-
#initialize(options) ⇒ Destroy
constructor
A new instance of Destroy.
- #remove ⇒ Object
- #scale ⇒ Object
Methods inherited from Storage
file, get, load, removal_complete, save, set, subset, subunset
Methods inherited from Base
#local_profile, #local_shell, #local_shell_env_include, #log, #remote_profile, #run
Constructor Details
#initialize(options) ⇒ Destroy
Returns a new instance of Destroy.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/rdeis/destroy.rb', line 7 def initialize() @options = @repo = DEIS::Git.name @verbose = ["verbose"] @environment = ["environment"] @cluster = ["cluster"] # location data that fetch from env as well as options from thor @proxy = if ! ["proxy"].nil? then ["proxy"] elsif ! ENV['RDEIS_PROXY'].nil? then ENV['RDEIS_PROXY'] else nil end @base_path = if ! ["path"].nil? then ["path"] elsif ! ENV['RDEIS_PATH'].nil? then ENV['RDEIS_PATH'] else ENV['HOME'] end # git data @ref = DEIS::Git.ref @branch = DEIS::Git.branch @remote = DEIS::Git.remote @name = @repo.gsub("_", "-")+"-"+@environment @deploy_to = @base_path.to_s + "/"+ @name + "/" @ssh = SSH.new({:host => @proxy, :user => nil}) if ! @proxy.nil? end |
Instance Attribute Details
#cluster ⇒ Object
Returns the value of attribute cluster.
5 6 7 |
# File 'lib/rdeis/destroy.rb', line 5 def cluster @cluster end |
#environment ⇒ Object
Returns the value of attribute environment.
5 6 7 |
# File 'lib/rdeis/destroy.rb', line 5 def environment @environment end |
#options ⇒ Object
Returns the value of attribute options.
5 6 7 |
# File 'lib/rdeis/destroy.rb', line 5 def @options end |
#output ⇒ Object
Returns the value of attribute output.
5 6 7 |
# File 'lib/rdeis/destroy.rb', line 5 def output @output end |
#path ⇒ Object
Returns the value of attribute path.
5 6 7 |
# File 'lib/rdeis/destroy.rb', line 5 def path @path end |
#proxy ⇒ Object
Returns the value of attribute proxy.
5 6 7 |
# File 'lib/rdeis/destroy.rb', line 5 def proxy @proxy end |
#verbose ⇒ Object
Returns the value of attribute verbose.
5 6 7 |
# File 'lib/rdeis/destroy.rb', line 5 def verbose @verbose end |
Instance Method Details
#all ⇒ Object
runs everyhing in order
49 50 51 52 53 54 |
# File 'lib/rdeis/destroy.rb', line 49 def all self.domains self.scale self.remove say "Complete", :blue end |
#domains ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/rdeis/destroy.rb', line 27 def domains dom = DEIS::Domains.new(@options) list = DEIS::Parse.list_array_to_var_string_array(dom.list(nil, nil)) dom.unset(list) if ! list.nil? && list.length > 0 # now deploy the change deploy = DEIS::Deploy.new(@options) deploy.domains("rm") end |