diff options
author | Pawel Wieczorek <p.wieczorek2@samsung.com> | 2020-01-07 15:27:54 +0100 |
---|---|---|
committer | Pawel Wieczorek <p.wieczorek2@samsung.com> | 2020-01-07 15:27:54 +0100 |
commit | 5aed5e739f2d78756d0f6a4c1d995f627565f8ae (patch) | |
tree | 9efaf0c042a046ee7ea325c00f7991d6ed97080b | |
parent | 9ee12584b8ae4f6b7f0f3269d3afab9f80f1c0a8 (diff) |
Replace URLs to Gerrit repositories with their cgit mirrors
Hound does not provide support for linking to source code in Gerrit
repositories. Support for cgit mirrors can be achieved by using URL
patterns.
Issue-ID: ONAPARC-540
Change-Id: Ib73b768d8a636680ab7e4d8d42463a16a9f45275
Signed-off-by: Pawel Wieczorek <p.wieczorek2@samsung.com>
-rwxr-xr-x | bootstrap/codesearch/create_config.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bootstrap/codesearch/create_config.py b/bootstrap/codesearch/create_config.py index 4009e51df..604338fd8 100755 --- a/bootstrap/codesearch/create_config.py +++ b/bootstrap/codesearch/create_config.py @@ -8,6 +8,7 @@ import urllib.request import sys ONAP_GERRIT = "https://gerrit.onap.org/r" +ONAP_CGIT = "https://git.onap.org" API_PROJECTS = "/projects/" MAGIC_PREFIX = ")]}'" @@ -27,7 +28,7 @@ def get_projects_list(): def create_repos_list(projects): """Create a map of all projects to their repositories' URLs.""" - return {p: {"url": "{}/{}.git".format(ONAP_GERRIT, p)} for p in projects} + return {p: {"url": "{}/{}".format(ONAP_CGIT, p), "url-pattern": {"base-url": "{url}/tree/{path}{anchor}", "anchor": "#n{line}"}} for p in projects} def main(): |