Sha256: 477908d451f6902fe32179293d7e03eda4e657f8172d0e6245034f98a4a69edb

Contents?: true

Size: 1.38 KB

Versions: 15

Compression:

Stored size: 1.38 KB

Contents

# frozen_string_literal: true

require 'ruby_fly'
require 'rake_factory'

module RakeFly
  module Tasks
    module Pipeline
      class Unpause < RakeFactory::Task
        default_name :unpause
        default_prerequisites(RakeFactory::DynamicValue.new do |t|
          [t.fly_ensure_task_name, t.authentication_ensure_task_name]
        end)
        default_description(RakeFactory::DynamicValue.new do |t|
          pipeline = t.pipeline || '<derived>'
          target = t.target || '<derived>'

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

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

        parameter :home_directory,
                  default: RakeFactory::DynamicValue.new { |_|
                             Dir.home
                           }

        parameter :fly_ensure_task_name, default: :'fly:ensure'
        parameter :authentication_ensure_task_name,
                  default: :'authentication:ensure'

        action do |t|
          $stdout.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

15 entries across 15 versions & 1 rubygems

Version Path
rake_fly-2.16.0.pre.2 lib/rake_fly/tasks/pipeline/unpause.rb
rake_fly-2.16.0.pre.1 lib/rake_fly/tasks/pipeline/unpause.rb
rake_fly-2.15.0 lib/rake_fly/tasks/pipeline/unpause.rb
rake_fly-2.14.0.pre.7 lib/rake_fly/tasks/pipeline/unpause.rb
rake_fly-2.14.0.pre.6 lib/rake_fly/tasks/pipeline/unpause.rb
rake_fly-2.14.0.pre.5 lib/rake_fly/tasks/pipeline/unpause.rb
rake_fly-2.14.0.pre.4 lib/rake_fly/tasks/pipeline/unpause.rb
rake_fly-2.14.0.pre.3 lib/rake_fly/tasks/pipeline/unpause.rb
rake_fly-2.14.0.pre.2 lib/rake_fly/tasks/pipeline/unpause.rb
rake_fly-2.14.0.pre.1 lib/rake_fly/tasks/pipeline/unpause.rb
rake_fly-2.13.0 lib/rake_fly/tasks/pipeline/unpause.rb
rake_fly-2.12.0.pre.2 lib/rake_fly/tasks/pipeline/unpause.rb
rake_fly-2.12.0.pre.1 lib/rake_fly/tasks/pipeline/unpause.rb
rake_fly-2.11.0 lib/rake_fly/tasks/pipeline/unpause.rb
rake_fly-2.10.0.pre.4 lib/rake_fly/tasks/pipeline/unpause.rb