From 7a0f69581f06beef4e7f9cf0c3b1600333930384 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 11 Sep 2020 09:55:18 +0800 Subject: [PATCH 1/3] support 20.03-lts-next branch --- src/build/osc_build_k8s.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/build/osc_build_k8s.py b/src/build/osc_build_k8s.py index 3e389de..6d8f929 100755 --- a/src/build/osc_build_k8s.py +++ b/src/build/osc_build_k8s.py @@ -12,6 +12,7 @@ class SinglePackageBuild(object): GITEEBRANCHPROJECTMAPPING = { "master": ["bringInRely", "openEuler:Extras", "openEuler:Factory", "openEuler:Mainline"], "openEuler-20.03-LTS": ["openEuler:20.03:LTS"], + "openEuler-20.03-LTS-Next": ["openEuler:20.03:LTS:Next"], "openEuler-EPOL-LTS": ["bringInRely"], "openEuler-20.09": ["openEuler:20.09"], "mkopeneuler-20.03": ["openEuler:Extras"] @@ -109,7 +110,8 @@ class SinglePackageBuild(object): elif param.get("name") == "tar_scm": param.text = "tar_local" elif param.get("name") == "url": - if "openEuler_kernel" in param.text or "LTS_kernel" in param.text or "openEuler-20.09_kernel" in param.text: + if "openEuler_kernel" in param.text or "LTS_kernel" in param.text \ + or "openEuler-20.09_kernel" in param.text: param.text = "{}/{}".format(code_path, "code") # kernel special logical else: gitee_repo = param.text.split("/")[-1] -- Gitee From 67471e18e7f0feb60e553091185de25a897efcb9 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 11 Sep 2020 10:45:20 +0800 Subject: [PATCH 2/3] fix pr 2 code style --- src/jobs/jenkins_job.py | 16 +++++++++------- src/jobs/obs_meta_strategy.py | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/jobs/jenkins_job.py b/src/jobs/jenkins_job.py index 5b87e9e..c1b58c9 100755 --- a/src/jobs/jenkins_job.py +++ b/src/jobs/jenkins_job.py @@ -3,7 +3,7 @@ import gevent from gevent import monkey monkey.patch_all() -from abc import ABCMeta, abstractmethod +import abc import os import stat import logging.config @@ -16,7 +16,7 @@ import argparse class JenkinsJobs(object): - __metaclass__ = ABCMeta + __metaclass__ = abc.ABCMeta def __init__(self, template_job, jenkins_proxy): """ @@ -86,7 +86,7 @@ class JenkinsJobs(object): return {"job": job, "result": result} - @abstractmethod + @abc.abstractmethod def get_real_target_jobs(self, jobs): """ 实际要操作的任务 @@ -95,7 +95,7 @@ class JenkinsJobs(object): """ return jobs - @abstractmethod + @abc.abstractmethod def update_config(self, job): raise NotImplementedError @@ -269,7 +269,7 @@ if "__main__" == __name__: args.add_argument("-f", type=str, dest="community", default="src-openeuler", help="src-openeuler or openeuler") args.add_argument("-a", type=str, dest="action", help="create or update") - args.add_argument("-c", type=int, dest="concurrency", default=75, help="jobs that send to jenkins server concurrency") + args.add_argument("-c", type=int, dest="concurrency", default=75, help="jobs send to jenkins server concurrency") args.add_argument("-r", type=int, dest="retry", default=3, help="retry times") args.add_argument("-i", type=int, dest="interval", default=0, help="retry interval") @@ -298,8 +298,10 @@ if "__main__" == __name__: jp_t = JenkinsProxy(args.target_job_base_url, args.jenkins_user, args.jenkins_api_token, args.jenkins_timeout) if args.community == "src-openeuler": - jenkins_jobs = SrcOpenEulerJenkinsJobs(args.template_job, jp_m, args.mapping_info_file, args.exclusive_arch_file) + jenkins_jobs = SrcOpenEulerJenkinsJobs( + args.template_job, jp_m, args.mapping_info_file, args.exclusive_arch_file) else: jenkins_jobs = OpenEulerJenkinsJobs(args.template_job, jp_m, args.mapping_info_file, args.exclusive_arch_file) - jenkins_jobs.run(args.action, args.target_jobs, jp_t, concurrency=args.concurrency, retry=args.retry, interval=args.interval) + jenkins_jobs.run( + args.action, args.target_jobs, jp_t, concurrency=args.concurrency, retry=args.retry, interval=args.interval) diff --git a/src/jobs/obs_meta_strategy.py b/src/jobs/obs_meta_strategy.py index 75f20b1..5dc61c9 100755 --- a/src/jobs/obs_meta_strategy.py +++ b/src/jobs/obs_meta_strategy.py @@ -65,7 +65,7 @@ class ObsMetaStrategy(object): logger.debug("analysis {}".format(_service)) tree = ET.parse(_service) elements = tree.findall(".//param[@name=\"url\"]") # next/openEuler/zip - except Exception: + except: logger.exception("invalid xml format, {}".format(_service)) continue -- Gitee From 67a84e82b4842de39f0e7e3dea3aa990e2752335 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 11 Sep 2020 10:50:00 +0800 Subject: [PATCH 3/3] fix code style --- src/jobs/jenkins_job.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/jobs/jenkins_job.py b/src/jobs/jenkins_job.py index c1b58c9..b3595da 100755 --- a/src/jobs/jenkins_job.py +++ b/src/jobs/jenkins_job.py @@ -16,6 +16,10 @@ import argparse class JenkinsJobs(object): + """ + handle jenkins job with batch + """ + __metaclass__ = abc.ABCMeta def __init__(self, template_job, jenkins_proxy): @@ -97,6 +101,11 @@ class JenkinsJobs(object): @abc.abstractmethod def update_config(self, job): + """ + implement in subclass + :param job: + :return: + """ raise NotImplementedError -- Gitee