Sha256: e2152c78253b3be3a41ddc9f76eeebbd16cdec1485e84c399725d7adb7eada8e

Contents?: true

Size: 1.15 KB

Versions: 2

Compression:

Stored size: 1.15 KB

Contents

require 'ruby_fly'
require_relative '../tasklib'

module RakeFly
  module Tasks
    class UnpausePipeline < TaskLib
      parameter :name, :default => :unpause_pipeline
      parameter :argument_names, :default => []

      parameter :target, :required => true
      parameter :pipeline, :required => true

      parameter :ensure_task, :default => :'fly:ensure'

      def process_arguments(args)
        self.name = args[0] if args[0]
      end

      def define
        desc "Unpause pipeline #{pipeline} for target #{target}"
        task name, argument_names => [ensure_task] do |_, args|
          derived_target = target.respond_to?(:call) ?
                               target.call(*[args].slice(0, target.arity)) :
                               target
          derived_pipeline = pipeline.respond_to?(:call) ?
                                 pipeline.call(*[args].slice(0, pipeline.arity)) :
                                 pipeline

          puts "Unpausing pipeline #{pipeline} for target #{target}..."
          RubyFly.unpause_pipeline(
              target: derived_target,
              pipeline: derived_pipeline)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rake_fly-0.5.0 lib/rake_fly/tasks/unpause_pipeline.rb
rake_fly-0.4.0 lib/rake_fly/tasks/unpause_pipeline.rb