Class: Strobe::Resources::Application

Inherits:
Object
  • Object
show all
Includes:
Strobe::Resource::Collection
Defined in:
lib/strobe/resources/application.rb

Defined Under Namespace

Classes: PackFile

Instance Attribute Summary

Attributes included from Strobe::Resource::Base

#response

Instance Method Summary collapse

Methods included from Strobe::Resource::Collection

#id, #key, #reload, #reload!

Methods included from Strobe::Resource::Base

#[], #[]=, #destroy, #initialize, #key?, #merge!, #params, #params=, #persisted?, #save, #save!

Methods included from Validations

#read_attribute_for_validation, #valid_attribute?, #valid_for_given_attributes?

Instance Method Details

#deploy!(opts = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/strobe/resources/application.rb', line 18

def deploy!(opts = {})
  self['path'] = opts[:path] if opts[:path]
  environment  = opts[:environment]

  validate_for_deploy or return

  request do
    qs       = "?environment=#{environment}" if environment
    packfile = build_packfile(opts)
    connection.put("#{http_uri}/deploy#{qs}", packfile, packfile.headers)
  end

  [ environment, self['url'] ].compact.join('.')
end