From: Aric Gardner Date: Wed, 11 Mar 2020 21:58:58 +0000 (-0400) Subject: Tweak initial project yaml file X-Git-Tag: v0.31.2^2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F82%2F63382%2F6;p=releng%2Flftools.git Tweak initial project yaml file Adds a project view drop branch (it is ignored) dont append the file with -info we will treat this as the projects first jjb file projects can build off of it. also change default builder if we are o-ran also fix example text, we use fqdn now Signed-off-by: Aric Gardner Change-Id: Ie7b56ad88769cd6ed6494162fc80ab8e8426392f --- diff --git a/lftools/api/endpoints/gerrit.py b/lftools/api/endpoints/gerrit.py index 00f166db..8befe168 100644 --- a/lftools/api/endpoints/gerrit.py +++ b/lftools/api/endpoints/gerrit.py @@ -98,7 +98,7 @@ class Gerrit(client.RestApi): Example: - gerrit_fqdn gerrit.o-ran-sc.org + fqdn gerrit.o-ran-sc.org gerrit_project test/test1 jjbrepo ci-mangement """ @@ -107,7 +107,7 @@ class Gerrit(client.RestApi): signed_off_by = config.get_setting(fqdn, "sob") gerrit_project_dashed = gerrit_project.replace("/", "-") gerrit_project_encoded = urllib.parse.quote(gerrit_project, safe="", encoding=None, errors=None) - filename = "info-{}.yaml".format(gerrit_project_dashed) + filename = "{}.yaml".format(gerrit_project_dashed) if not reviewid: payload = self.create_change(filename, jjbrepo, issue_id, signed_off_by) @@ -120,23 +120,30 @@ class Gerrit(client.RestApi): else: changeid = reviewid + if fqdn == "gerrit.o-ran-sc.org": + buildnode = "centos7-builder-1c-1g" + else: + buildnode = "centos7-builder-2c-1g" + my_inline_file = """--- +- project: + name: {0}-project-view + project-name: {0} + views: + - project-view\n - project: name: {0}-info + project: {1} project-name: {0} - build-node: centos7-builder-2c-1g + build-node: {2} jobs: - - gerrit-info-yaml-verify - project: {1} - branch: master\n""".format( - gerrit_project_dashed, gerrit_project + - gerrit-info-yaml-verify\n""".format( + gerrit_project_dashed, gerrit_project, buildnode ) my_inline_file_size = len(my_inline_file.encode("utf-8")) headers = {"Content-Type": "text/plain", "Content-length": "{}".format(my_inline_file_size)} self.r.headers.update(headers) - access_str = "changes/{0}/edit/jjb%2F{1}%2Finfo-{2}.yaml".format( - changeid, gerrit_project_encoded, gerrit_project_dashed - ) + access_str = "changes/{0}/edit/jjb%2F{1}%2F{1}.yaml".format(changeid, gerrit_project_dashed) payload = my_inline_file log.info(access_str) result = self.put(access_str, data=payload) @@ -233,7 +240,7 @@ class Gerrit(client.RestApi): Example: - gerrit_fqdn gerrit.o-ran-sc.org + fqdn gerrit.o-ran-sc.org gerrit_project test/test1 issue_id: CIMAN-33 """