class Albacore::AppSpec::Defaults

The default is to get the bin/ folder based on the configuration that you have compiled the project with.

Public Instance Methods

deploy_dir(app_spec) click to toggle source

Gets the location fully qualified path that the finished artefact will be installed into. Defaults to C:\Services\{id}.

# File lib/albacore/app_spec/defaults.rb, line 43
def deploy_dir app_spec
  app_spec.conf['deploy_dir'] || "C:\\Services\\#{app_spec.id}"
end
embedded_resource(relative_path) click to toggle source

Get the relative resource from 'albacore/app_spec/.' as a string.

# File lib/albacore/app_spec/defaults.rb, line 48
def embedded_resource relative_path
  File.open(embedded_resource_path(relative_path), 'r') { |io| io.read }
end
embedded_resource_path(relative_path) click to toggle source

Get the relative resource path from 'albacore/app_spec/.'

# File lib/albacore/app_spec/defaults.rb, line 53
def embedded_resource_path relative_path
  File.join(File.dirname(File.expand_path(__FILE__)), relative_path)
end
install_script(out, app_spec, &block) click to toggle source

create a chocolatey install script for a topshelf service on windows

write tools/chocolateyInstall.ps1

# File lib/albacore/app_spec/defaults.rb, line 28
def install_script out, app_spec, &block
  debug { "installing into '#{out}' [app_spec/defaults#install_script]" }
  tools = "#{out}/#{app_spec.id}/tools"

  FileUtils.mkdir tools unless Dir.exists? tools
  File.open(File.join(tools, 'chocolateyInstall.ps1'), 'w+') do |io|
    contents = embedded_resource '../../../resources/chocolateyInstall.ps1'
    io.write contents
    write_invocation app_spec, io
  end
end
nuget_contents() click to toggle source

location/folder inside nuget to place everything found in the relative_dir inside

# File lib/albacore/app_spec/defaults.rb, line 14
def nuget_contents
  'bin'
end
source_dir(app_spec, configuration = 'Release') click to toggle source

Where to copy contents from

# File lib/albacore/app_spec/defaults.rb, line 19
def source_dir app_spec, configuration = 'Release'
  Paths.normalise_slashes( File.join(app_spec.proj.proj_path_base,
            app_spec.bin_folder(configuration),
            '.'))
end
write_invocation(app_spec, io) click to toggle source
# File lib/albacore/app_spec/defaults.rb, line 57
    def write_invocation app_spec, io
      debug { 'writing default powershell invocation [app_spec/defaults#write_invocation]' }

      io.write %{
Install-Service `
  -ServiceExeName "#{app_spec.exe}" -ServiceDir "#{deploy_dir app_spec}" `
  -CurrentPath (Split-Path $MyInvocation.MyCommand.Path)
}
    end