Sha256: f4fa59659faeef0e42e65a15e4fe53d6caf48d78748bee10ee074f4629d329e9

Contents?: true

Size: 1.12 KB

Versions: 4

Compression:

Stored size: 1.12 KB

Contents

require 'ruby_fly'
require 'rake_factory'

module RakeFly
  module Tasks
    module Pipeline
      class Unpause < RakeFactory::Task
        default_name :unpause
        default_prerequisites RakeFactory::DynamicValue.new { |t|
          [t.ensure_task_name]
        }
        default_description RakeFactory::DynamicValue.new { |t|
          pipeline = t.pipeline || '<derived>'
          target = t.target || '<derived>'

          "Unpause pipeline #{pipeline} for target #{target}"
        }

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

        parameter :home_directory,
            default: RakeFactory::DynamicValue.new { |_| ENV['HOME'] }

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

        action do |t|
          puts "Unpausing pipeline #{t.pipeline} for target #{t.target}..."
          RubyFly.unpause_pipeline(
              target: t.target,
              team: t.team,
              pipeline: t.pipeline,
              environment: {
                  "HOME" => t.home_directory
              })
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rake_fly-2.2.0.pre.6 lib/rake_fly/tasks/pipeline/unpause.rb
rake_fly-2.2.0.pre.5 lib/rake_fly/tasks/pipeline/unpause.rb
rake_fly-2.2.0.pre.4 lib/rake_fly/tasks/pipeline/unpause.rb
rake_fly-2.2.0.pre.3 lib/rake_fly/tasks/pipeline/unpause.rb