Sha256: cf1845020687f643b44506c6f4d545b83a95c125537f1392229fe51ee12cec88

Contents?: true

Size: 1.52 KB

Versions: 15

Compression:

Stored size: 1.52 KB

Contents

require 'ruby_fly'
require 'rake_factory'

module RakeFly
  module Tasks
    module Pipeline
      class Set < RakeFactory::Task
        default_name :set
        default_prerequisites RakeFactory::DynamicValue.new { |t|
          [t.fly_ensure_task_name, t.authentication_ensure_task_name]
        }
        default_description RakeFactory::DynamicValue.new { |t|
          pipeline = t.pipeline || '<derived>'
          target = t.target || '<derived>'

          "Set pipeline #{pipeline} for target #{target}"
        }

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

        parameter :vars
        parameter :var_files
        parameter :non_interactive

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

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

        action do |t|
          puts "Setting pipeline #{t.pipeline} for target #{t.target}..."
          RubyFly.set_pipeline(
              target: t.target,
              team: t.team,
              pipeline: t.pipeline,
              config: t.config,
              vars: t.vars,
              var_files: t.var_files,
              non_interactive: t.non_interactive,
              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.10.0.pre.2 lib/rake_fly/tasks/pipeline/set.rb
rake_fly-2.10.0.pre.1 lib/rake_fly/tasks/pipeline/set.rb
rake_fly-2.9.0 lib/rake_fly/tasks/pipeline/set.rb
rake_fly-2.8.0.pre.5 lib/rake_fly/tasks/pipeline/set.rb
rake_fly-2.8.0.pre.4 lib/rake_fly/tasks/pipeline/set.rb
rake_fly-2.8.0.pre.3 lib/rake_fly/tasks/pipeline/set.rb
rake_fly-2.8.0.pre.2 lib/rake_fly/tasks/pipeline/set.rb
rake_fly-2.8.0.pre.1 lib/rake_fly/tasks/pipeline/set.rb
rake_fly-2.7.0 lib/rake_fly/tasks/pipeline/set.rb
rake_fly-2.6.0.pre.1 lib/rake_fly/tasks/pipeline/set.rb
rake_fly-2.5.0 lib/rake_fly/tasks/pipeline/set.rb
rake_fly-2.4.0.pre.1 lib/rake_fly/tasks/pipeline/set.rb
rake_fly-2.3.0 lib/rake_fly/tasks/pipeline/set.rb
rake_fly-2.2.0.pre.8 lib/rake_fly/tasks/pipeline/set.rb
rake_fly-2.2.0.pre.7 lib/rake_fly/tasks/pipeline/set.rb