class Albacore::SqlPackage::Config
The configuration class for SqlPackage
. MSDN docs at: msdn.microsoft.com/en-us/library/hh550080(vs.103).aspx
Attributes
this is the action of SqlPackage
this is the profile of SqlPackage
any properties you want to set
this is the sql_package
of SqlPackage
Public Class Methods
# 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
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
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
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
# File lib/albacore/task_types/sql_package.rb, line 107 def make_props @properties.collect { |k, v| "#{k}=#{v}" }.join(';') end
# 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