Class: Albacore::AppSpec::IisSite

Inherits:
Defaults
  • Object
show all
Includes:
CrossPlatformCmd, Logging
Defined in:
lib/albacore/app_spec/iis_site.rb

Overview

In the case of building an IIS site we expect the site to have been ‘Published’ to a specific folder from which we can then fetch the contents.

If you want the default behaviour of only packaging the bin/ folder with the compiled artifacts, use ‘albacore/app_spec/defaults’ instead.

While this class is inheriting the defaults, it’s still overriding almost/all methods.

Constant Summary

Constants included from CrossPlatformCmd

CrossPlatformCmd::KILL_TIMEOUT

Instance Attribute Summary

Attributes included from CrossPlatformCmd

#pid

Instance Method Summary collapse

Methods included from CrossPlatformCmd

#chdir, #initialize, #make_command, #normalise_slashes, #sh, #shie, #stop, #system, #which

Methods included from Logging

#debug, #err, #error, #fatal, #info, #puts, #trace, #warn

Methods inherited from Defaults

#embedded_resource, #embedded_resource_path, #install_script

Instance Method Details

#deploy_dir(app_spec) ⇒ Object

Overrides the default deploy dir with a folder that is NOT services, unless the property is set in the .appspec file.



51
52
53
# File 'lib/albacore/app_spec/iis_site.rb', line 51

def deploy_dir app_spec
  app_spec.conf['deploy_dir'] || "C:\\WebSites"
end

#nuget_contentsObject

location/folder inside nuget to place everything found in the #source_dir inside



20
21
22
# File 'lib/albacore/app_spec/iis_site.rb', line 20

def nuget_contents
  'contents'
end

#source_dir(app_spec, configuration = 'Release') ⇒ Object

where to copy from - will copy ALL contents of this directory - in this case will copy from the directory that the appspec is in.



27
28
29
# File 'lib/albacore/app_spec/iis_site.rb', line 27

def source_dir app_spec, configuration = 'Release'
  "#{File.dirname(app_spec.path)}/."
end

#write_invocation(app_spec, io) ⇒ Object

Extends the outputted data with the installation routines



33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/albacore/app_spec/iis_site.rb', line 33

def write_invocation app_spec, io
  debug { 'writing iis site installation invocation [app_spec/iis_site#write_invocation]' }

  site_installation_function = embedded_resource '../../../resources/installSite.ps1'
  io.write %{
#{site_installation_function}

# deliberately lowercase id/name/title.
Install-Site -SiteName '#{app_spec.title}' `
-Port #{app_spec.port} `
-HostHeader '#{app_spec.host_header}' `
-WebSiteRootFolder '#{normalise_slashes(deploy_dir(app_spec))}'
}
end