Sha256: 03aae732b80b7a939ec5907e9fcb2e2d8d0f423b987fe0a5e41d493d467592fb

Contents?: true

Size: 1.18 KB

Versions: 9

Compression:

Stored size: 1.18 KB

Contents

module Actions
  module Katello
    module ContentView
      class Promote < Actions::EntryAction
        middleware.use Actions::Middleware::KeepCurrentUser

        def plan(version, environments, is_force = false, description = nil, options = {})
          action_subject(version.content_view)
          version.check_ready_to_promote!(environments)

          fail ::Katello::HttpErrors::BadRequest, _("Cannot promote environment out of sequence. Use force to bypass restriction.") if !is_force && !version.promotable?(environments)

          # Pass the environments as input in order to make them accessible to UI alerts
          plan_self(environments: environments.map(&:name))
          environments.each do |environment|
            sequence do
              plan_action(Katello::ContentViewVersion::BeforePromoteHook, :id => version.id)
              plan_action(ContentView::PromoteToEnvironment, version, environment, description,
                          :force_yum_metadata_regeneration => options[:force_yum_metadata_regeneration])
              plan_action(Katello::ContentViewVersion::AfterPromoteHook, :id => version.id)
            end
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
katello-3.9.1 app/lib/actions/katello/content_view/promote.rb
katello-3.9.0 app/lib/actions/katello/content_view/promote.rb
katello-3.8.1 app/lib/actions/katello/content_view/promote.rb
katello-3.9.0.rc2 app/lib/actions/katello/content_view/promote.rb
katello-3.9.0.rc1 app/lib/actions/katello/content_view/promote.rb
katello-3.8.0 app/lib/actions/katello/content_view/promote.rb
katello-3.8.0.rc3 app/lib/actions/katello/content_view/promote.rb
katello-3.8.0.rc2 app/lib/actions/katello/content_view/promote.rb
katello-3.8.0.rc1 app/lib/actions/katello/content_view/promote.rb