class Albacore::SqlPackage::Config

The configuration class for SqlPackage. MSDN docs at: msdn.microsoft.com/en-us/library/hh550080(vs.103).aspx

Attributes

action[R]

this is the action of SqlPackage

profile[R]

this is the profile of SqlPackage

properties[RW]

any properties you want to set

sql_package[R]

this is the sql_package of SqlPackage

Public Class Methods

new() click to toggle source
# File lib/albacore/task_types/sql_package.rb, line 45
def initialize
  @parameters = Set.new

  w = lambda { |e| CrossPlatformCmd.which(e) ? e : nil }

  @exe = w.call( "SqlPackage" ) 

  debug { "SqlPackage using '#{@exe}'" }

end

Public Instance Methods

be_quiet() click to toggle source

Specifies whether detailed feedback is suppressed. Defaults to False.

# File lib/albacore/task_types/sql_package.rb, line 84
def be_quiet
  @parameters.add "/Quiet:True"
end
prop(k, v) click to toggle source

Allows you to add properties to MsBuild; example:

b.prop 'CommandTimeout', 60 b.prop 'DacMajorVersion', 1

The properties will be automatically converted to the correct syntax

# File lib/albacore/task_types/sql_package.rb, line 62
def prop k, v
  @properties ||= Hash.new
  @parameters.delete "/p:#{make_props}" if @properties.any?
  @properties[k] = v
  @parameters.add "/p:#{make_props}"
end
verify_deployment() click to toggle source

Specifies whether checks should be performed before publishing that will stop the publish action if issues are present that might block successful publishing. For example, your publish action might stop if you have foreign keys on the target database that do not exist in the database project, and that will cause errors when you publish.

# File lib/albacore/task_types/sql_package.rb, line 79
def verify_deployment
  @parameters.add "/p:VerifyDeployment=True"
end

Private Instance Methods

make_props() click to toggle source
# File lib/albacore/task_types/sql_package.rb, line 107
def make_props
  @properties.collect { |k, v|
    "#{k}=#{v}"
  }.join(';')
end
set_action(action) click to toggle source
# File lib/albacore/task_types/sql_package.rb, line 101
def set_action action
  actions = %w{Extract DeployReport DriftReport Publish Script Export Import Pipe}.collect{ |a| "/Action:#{a}" }
  @parameters.subtract actions
  @parameters.add "/Action:#{action}"
end