Commit 9fcb63db authored by Stan Hu's avatar Stan Hu

Add primary node clone URL to Geo secondary 'How to work faster with Geo' popover

Closes #2555
parent 7a048641
...@@ -4,6 +4,10 @@ module EE ...@@ -4,6 +4,10 @@ module EE
File.join(::Gitlab::Geo.primary_node.url, ::Gitlab::Routing.url_helpers.namespace_project_path(project.namespace, project)) File.join(::Gitlab::Geo.primary_node.url, ::Gitlab::Routing.url_helpers.namespace_project_path(project.namespace, project))
end end
def geo_primary_ssh_url_to_repo(project)
"#{::Gitlab::Geo.primary_node.clone_url_prefix}#{project.path_with_namespace}"
end
def geo_primary_http_url_to_repo(project) def geo_primary_http_url_to_repo(project)
"#{geo_primary_web_url(project)}.git" "#{geo_primary_web_url(project)}.git"
end end
...@@ -12,6 +16,8 @@ module EE ...@@ -12,6 +16,8 @@ module EE
case default_clone_protocol case default_clone_protocol
when 'http' when 'http'
geo_primary_http_url_to_repo(project) geo_primary_http_url_to_repo(project)
when 'ssh'
geo_primary_ssh_url_to_repo(project)
end end
end end
end end
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
remote: remote:
= clipboard_button(target: 'pre#geo-info-2') = clipboard_button(target: 'pre#geo-info-2')
%pre#geo-info-2.dark %pre#geo-info-2.dark
git remote set-url --push origin <clone url for primary repository> git remote set-url --push origin #{geo_primary_default_url_to_repo(project)}
%p %p
%strong= 'Done.' %strong= 'Done.'
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
'git clone ' + 'git clone ' +
(data.cloneUrlSecondary || '<clone url for secondary repository>') (data.cloneUrlSecondary || '<clone url for secondary repository>')
); );
$('geo-info-2').text( $('#geo-info-2').text(
'git remote set-url --push origin ' + 'git remote set-url --push origin ' +
(data.cloneUrlPrimary || '<clone url for primary repository>') (data.cloneUrlPrimary || '<clone url for primary repository>')
); );
......
---
title: Add primary node clone URL to Geo secondary 'How to work faster with Geo' popover
merge_request:
author:
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment