Class: Actions::Katello::Repository::CloneToVersion

Inherits:
Base
  • Object
show all
Defined in:
app/lib/actions/katello/repository/clone_to_version.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#new_repositoryObject

allows accessing the build object from the superior action



6
7
8
# File 'app/lib/actions/katello/repository/clone_to_version.rb', line 6

def new_repository
  @new_repository
end

Instance Method Details

#plan(repository, content_view_version, incremental = false) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/lib/actions/katello/repository/clone_to_version.rb', line 8

def plan(repository, content_view_version, incremental = false)
  content_view = content_view_version.content_view
  filters = incremental ? [] : content_view.filters.applicable(repository)
  self.new_repository = repository.build_clone(content_view: content_view,
                                               version: content_view_version)
  sequence do
    plan_action(Repository::Create, new_repository, true, false)

    if new_repository.yum?
      plan_action(Repository::CloneYumContent, repository, new_repository, filters, !incremental,
                  :generate_metadata => !incremental, :index_content => !incremental, :simple_clone => incremental)
    elsif new_repository.docker?
      plan_action(Repository::CloneDockerContent, repository, new_repository)
    elsif new_repository.ostree?
      plan_action(Repository::CloneOstreeContent, repository, new_repository)
    end
  end
end