Skip to content

Commit

Permalink
[api] Support kiwi for remote branching
Browse files Browse the repository at this point in the history
Support kiwi images when copy repositories from a branched remote project.
  • Loading branch information
Ana06 committed Apr 19, 2017
1 parent f0885bb commit c0a3eda
Show file tree
Hide file tree
Showing 5 changed files with 791 additions and 48 deletions.
17 changes: 14 additions & 3 deletions src/api/app/models/project.rb
Expand Up @@ -988,9 +988,20 @@ def branch_remote_repositories(project)
repository_node = local_project_meta.create_element("repository")
repository_node["name"] = repository

path_elements = local_project_meta.create_element("path")
path_elements["project"] = project
path_elements["repository"] = repository
# if it is kiwi type
if repository == "images"
path_elements = remote_project_meta.xpath("//repository[@name='images']/path")

prjconf = source_file('_config')
unless prjconf =~ /^Type:/
prjconf = "%if \"%_repository\" == \"images\"\nType: kiwi\nRepotype: none\nPatterntype: none\n%endif\n" << prjconf
Backend::Connection.put_source(source_path('_config'), prjconf)
end
else
path_elements = local_project_meta.create_element("path")
path_elements["project"] = project
path_elements["repository"] = repository
end
repository_node.add_child(path_elements)

architectures = remote_project_meta.xpath("//repository[@name='#{repository}']/arch")
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c0a3eda

Please sign in to comment.