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
File.join(::Gitlab::Geo.primary_node.url, ::Gitlab::Routing.url_helpers.namespace_project_path(project.namespace, project))
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)
"#{geo_primary_web_url(project)}.git"
end
......@@ -12,6 +16,8 @@ module EE
case default_clone_protocol
when 'http'
geo_primary_http_url_to_repo(project)
when 'ssh'
geo_primary_ssh_url_to_repo(project)
end
end
end
......
......@@ -21,7 +21,7 @@
remote:
= clipboard_button(target: 'pre#geo-info-2')
%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
%strong= 'Done.'
......@@ -37,7 +37,7 @@
'git clone ' +
(data.cloneUrlSecondary || '<clone url for secondary repository>')
);
$('geo-info-2').text(
$('#geo-info-2').text(
'git remote set-url --push origin ' +
(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