Sha256: 0d0d385328523500dcf22d90da8abb23e00f07d295292607bab5f451993358c5

Contents?: true

Size: 1.91 KB

Versions: 27

Compression:

Stored size: 1.91 KB

Contents

module BastionKatello
  class Engine < ::Rails::Engine
    isolate_namespace BastionKatello

    initializer 'bastion.assets_dispatcher', :before => :build_middleware_stack do |app|
      app.middleware.use ::ActionDispatch::Static, "#{BastionKatello::Engine.root}/app/assets/javascripts/bastion_katello"
    end

    config.to_prepare do
      consumer_cert_rpm = 'katello-ca-consumer-latest.noarch.rpm'
      consumer_cert_rpm = SETTINGS[:katello][:consumer_cert_rpm] if SETTINGS.key?(:katello)

      db_migrated = !Foreman.in_setup_db_rake? && ActiveRecord::Base.connection.table_exists?(Setting.table_name)

      Bastion.register_plugin(
        :name => 'bastion_katello',
        :javascript => proc do
          [
            javascript_include_tag(*webpack_asset_paths('katello:common', :extension => 'js'), "data-turbolinks-track" => true),
            javascript_include_tag('bastion_katello/bastion_katello')
          ]
        end,
        :stylesheet => 'bastion_katello/bastion_katello',
        :pages => %w(
          activation_keys
          content_credentials
          content_hosts
          debs
          docker_tags
          files
          errata
          packages
          lifecycle_environments
          products
          sync_plans
          host_collections
          katello_tasks
          select_organization
        ),
        :config_generator =>  lambda do
          { 'consumerCertRPM' => consumer_cert_rpm,
            'defaultDownloadPolicy' => !Foreman.in_rake? && db_migrated && Setting['default_download_policy'],
            'katelloAgentPresent' => ::Katello.with_katello_agent?,
            'remoteExecutionPresent' => ::Katello.with_remote_execution?,
            'hostToolingEnabled' => (::Katello.with_katello_agent? || ::Katello.with_remote_execution?) ? true : false,
            'remoteExecutionByDefault' => ::Katello.remote_execution_by_default?
          }
        end
      )
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
katello-4.9.2 engines/bastion_katello/lib/bastion_katello/engine.rb
katello-4.8.4 engines/bastion_katello/lib/bastion_katello/engine.rb
katello-4.9.1 engines/bastion_katello/lib/bastion_katello/engine.rb
katello-4.8.3 engines/bastion_katello/lib/bastion_katello/engine.rb
katello-4.9.0 engines/bastion_katello/lib/bastion_katello/engine.rb
katello-4.7.6 engines/bastion_katello/lib/bastion_katello/engine.rb
katello-4.8.2 engines/bastion_katello/lib/bastion_katello/engine.rb
katello-4.9.0.rc2 engines/bastion_katello/lib/bastion_katello/engine.rb
katello-4.9.0.rc1 engines/bastion_katello/lib/bastion_katello/engine.rb
katello-4.8.1 engines/bastion_katello/lib/bastion_katello/engine.rb
katello-4.7.5 engines/bastion_katello/lib/bastion_katello/engine.rb
katello-4.8.0 engines/bastion_katello/lib/bastion_katello/engine.rb
katello-4.8.0.rc2 engines/bastion_katello/lib/bastion_katello/engine.rb
katello-4.7.4 engines/bastion_katello/lib/bastion_katello/engine.rb
katello-4.8.0.rc1 engines/bastion_katello/lib/bastion_katello/engine.rb
katello-4.7.3 engines/bastion_katello/lib/bastion_katello/engine.rb
katello-4.7.2 engines/bastion_katello/lib/bastion_katello/engine.rb
katello-4.7.1 engines/bastion_katello/lib/bastion_katello/engine.rb
katello-4.6.2.1 engines/bastion_katello/lib/bastion_katello/engine.rb
katello-4.6.2 engines/bastion_katello/lib/bastion_katello/engine.rb