Sha256: 818e5e802963d13b65b18fc01e6b8fdfc9fdffc85dcce893ceaca363531bbfe7

Contents?: true

Size: 873 Bytes

Versions: 2

Compression:

Stored size: 873 Bytes

Contents

require "albacore/albacoretask"
require "albacore/config/nugetpushconfig"

class NuGetPush
  TaskName = :nugetpush

  include Albacore::Task
  include Albacore::RunCommand
  include Configuration::NuGetPush
  
  attr_accessor :package,
                :api_key,
                :source

  def initialize()
    @command = "nuget"
    
    super()
    update_attributes(nugetpush.to_hash)
  end

  def execute
    unless @package
      fail_with_message("nugetinstall requires #package")
      return
    end

    result = run_command("nugetpush", build_parameters)
    fail_with_message("NuGet Push failed, see the build log for more details.") unless result
  end
  
  def build_parameters
    p = []
    p << "push"
    p << "\"#{@package}\""
    p << "#{@api_key}" if @api_key
    p << "-Source #{source}" if @source
    p
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
albacore-1.0.0 lib/albacore/nugetpush.rb
albacore-1.0.0.rc.3 lib/albacore/nugetpush.rb