Sha256: 53c6e9cc43e78f064a3bd94b6978a170c7ffcbeb84c6c34b84a6be47519e971e

Contents?: true

Size: 1.75 KB

Versions: 9

Compression:

Stored size: 1.75 KB

Contents

require 'albacore/albacoretask'

class FluentMigratorRunner
	TaskName = :fluentmigrator
	include Albacore::Task
	include Albacore::RunCommand

	attr_accessor :target, :provider, :connection, :namespace, :output, :output_filename, :preview, :steps, :task, :version, :verbose, :script_directory, :profile, :timeout, :show_help

	def initialize(command=nil)
		super()
		update_attributes Albacore.configuration.fluentmigrator.to_hash
		@command = command unless command.nil?
	end

  def get_command_line
    commandline = "#{@command}"
    commandline << get_command_parameters
    @logger.debug "Build FuentMigrator Test Runner Command Line: " + commandline
    commandline
  end

	def get_command_parameters
    if @show_help
      params = " /?"
    else
      params = " /target=\"#{@target}\""
      params << " /provider=#{@provider}"
      params << " /connection=\"#{@connection}\""
      params << " /ns=#{@namespace}" unless @namespace.nil?
      params << " /out" if @output == true
      params << " /outfile=\"#{@output_filename}\"" unless @output_filename.nil?
      params << " /preview" if @preview == true
      params << " /steps=#{@steps}" unless @steps.nil?
      params << " /task=#{@task}" unless @task.nil?
      params << " /version=#{@version}" unless @version.nil?
      params << " /verbose=#{@verbose}" if @verbose == true
      params << " /wd=\"#{@script_directory}\"" unless @script_directory.nil?
      params << " /profile=#{@profile}" unless @profile.nil?
      params << " /timeout=#{@timeout}" unless @timeout.nil?
    end 
    params
	end

	def execute()
    result = run_command "FluentMigrator", get_command_parameters

    failure_message = "FluentMigrator failed. See build log for detail."
    fail_with_message failure_message if !result
	end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
albacore-0.3.6 lib/albacore/fluentmigratorrunner.rb
albacore-0.3.5 lib/albacore/fluentmigratorrunner.rb
albacore-0.3.4 lib/albacore/fluentmigratorrunner.rb
albacore-0.3.3 lib/albacore/fluentmigratorrunner.rb
albacore-0.3.2 lib/albacore/fluentmigratorrunner.rb
albacore-0.3.1 lib/albacore/fluentmigratorrunner.rb
albacore-0.3.0 lib/albacore/fluentmigratorrunner.rb
albacore-0.2.7 lib/albacore/fluentmigratorrunner.rb
albacore-0.2.6 lib/albacore/fluentmigratorrunner.rb