This commit is contained in:
parent
6a8b8fec3a
commit
cacd9eb301
|
@ -6,7 +6,7 @@
|
||||||
<% @projects.each do |project| %>
|
<% @projects.each do |project| %>
|
||||||
[
|
[
|
||||||
"<%=j link_to("#{project.owner.respond_to?(:uname) ? project.owner.uname : project.owner.name} / #{project.name}", project) %>",
|
"<%=j link_to("#{project.owner.respond_to?(:uname) ? project.owner.uname : project.owner.name} / #{project.name}", project) %>",
|
||||||
"<%= truncate(project.description || '', :length => 60).gsub("\n", ' ') %>",
|
"<%= truncate(project.description || '', :length => 60).gsub("\n", ' ').gsub("\r", ' ') %>",
|
||||||
"<%=j link_to t("layout.add"), url_for(:controller => :repositories, :action => :add_project, :project_id => project.id) %>"
|
"<%=j link_to t("layout.add"), url_for(:controller => :repositories, :action => :add_project, :project_id => project.id) %>"
|
||||||
]<%= project == @projects.last ? '' : ',' %>
|
]<%= project == @projects.last ? '' : ',' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
j(link_to("#{project.owner.respond_to?(:uname) ? project.owner.uname : project.owner.name} / #{project.name}", project)) +
|
j(link_to("#{project.owner.respond_to?(:uname) ? project.owner.uname : project.owner.name} / #{project.name}", project)) +
|
||||||
"</div>").html_safe
|
"</div>").html_safe
|
||||||
%>",
|
%>",
|
||||||
"<%= truncate(project.description || '', :length => 60).gsub("\n", ' ') %>",
|
"<%= truncate(project.description || '', :length => 60).gsub("\n", ' ').gsub("\r", ' ') %>",
|
||||||
"<%=
|
"<%=
|
||||||
if can? :remove_project, @repository
|
if can? :remove_project, @repository
|
||||||
j(link_to('<span class="delete"> </span>'.html_safe,
|
j(link_to('<span class="delete"> </span>'.html_safe,
|
||||||
|
|
|
@ -9,12 +9,12 @@ task :add_branch => :environment do
|
||||||
Platform.find_by_name(dst_branch).repositories.each do |r|
|
Platform.find_by_name(dst_branch).repositories.each do |r|
|
||||||
say "=== Process #{r.name} repo"
|
say "=== Process #{r.name} repo"
|
||||||
r.projects.find_each do |p|
|
r.projects.find_each do |p|
|
||||||
|
next if p.branches.map(&:name).include?(dst_branch)
|
||||||
say "===== Process #{p.name} project"
|
say "===== Process #{p.name} project"
|
||||||
tmp_path = Rails.root.join('tmp', p.name)
|
tmp_path = Rails.root.join('tmp', p.name)
|
||||||
system("git clone #{p.path} #{tmp_path}")
|
system("git clone #{p.path} #{tmp_path}")
|
||||||
system("cd #{tmp_path} && git checkout remotes/origin/#{src_branch}") or system("cd #{tmp_path} && git checkout master")
|
system("cd #{tmp_path} && git checkout remotes/origin/#{src_branch} || git checkout master")
|
||||||
system("cd #{tmp_path} && git checkout -b #{dst_branch}")
|
system("cd #{tmp_path} && git checkout -b #{dst_branch} && git push origin HEAD")
|
||||||
system("cd #{tmp_path} && git push origin HEAD")
|
|
||||||
FileUtils.rm_rf tmp_path
|
FileUtils.rm_rf tmp_path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue