Module: Deployment::Methods::IIS

Defined in:
lib/depengine/dsl/iis.rb

Instance Method Summary collapse

Instance Method Details

#iis_appcmdObject



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/depengine/dsl/iis.rb', line 56

def iis_appcmd()
  Helper.validates_presence_of @cdb['iis_appcmd_url'], \
                               "iis_appcmd_url parameter is missing"
  Helper.validates_presence_of $recipe_config['VALUE'], \
                               "VALUE parameter is missing"

  iis          = ::Publisher::IIS.new
  iis.protocol = @cdb['iis_appcmd_protocol']
  iis.url     = @cdb['iis_appcmd_url']
  if @cdb['http_read_timeout']
    iis.http_read_timeout = @cdb['http_read_timeout']
  else
     iis.http_read_timeout = 180
  end
  iis.appcmd($recipe_config['VALUE'])

end

#iis_buildObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/depengine/dsl/iis.rb', line 5

def iis_build()
  Helper.validates_presence_of @cdb['iis_build_url'], \
                               "iis_build_url parameter is missing"
  Helper.validates_presence_of @cdb['iis_build_protocol'], \
                               "iis_build_protocol parameter is missing"
  Helper.validates_presence_of $recipe_config['TAG'], \
                               "TAG parameter is missing"
  Helper.validates_presence_of $recipe_config['ENVIRONMENT'], \
                               "ENV parameter is missing"
  Helper.validates_presence_of  @version['app'], \
                               "VERSION parameter is missing"
  Helper.validates_presence_of $recipe_config['VALUE'], \
                               "VALUE parameter is missing"

  iis          = ::Publisher::IIS.new
  iis.protocol = @cdb['iis_build_protocol']
  iis.url     = @cdb['iis_build_url']
  if @cdb['http_read_timeout']
    iis.http_read_timeout = @cdb['http_read_timeout']
  else
     iis.http_read_timeout = 180
  end

  iis.build($recipe_config['TAG'], $recipe_config['ENVIRONMENT'], @version['app'], $recipe_config['VALUE'], $recipe_config[:application_name])
end

#iis_deploy(options = {}) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/depengine/dsl/iis.rb', line 31

def iis_deploy(options={})
  Helper.validates_presence_of options[:iis_deploy_url] || @cdb['iis_deploy_url'], \
                               "iis_deploy_url parameter is missing"
  Helper.validates_presence_of @cdb['iis_application_name'], \
                               "iis_application_name parameter is missing"
  Helper.validates_presence_of @cdb['iis_deploy_protocol'], \
                               "iis_deploy_protocol parameter is missing"
  Helper.validates_presence_of $recipe_config['ENVIRONMENT'], \
                               "ENV parameter is missing"
  Helper.validates_presence_of  @version['app'], \
                               "VERSION parameter is missing"

  iis          = ::Publisher::IIS.new
  iis.protocol = @cdb['iis_deploy_protocol']
  iis.url     = options[:iis_deploy_url] || @cdb['iis_deploy_url']
  if @cdb['http_read_timeout']
    iis.http_read_timeout = @cdb['http_read_timeout']
  else
     iis.http_read_timeout = 180
  end

  iis.deploy(@version['app'], @cdb['iis_application_name'], $recipe_config['ENVIRONMENT'].downcase)
end