From: SoonKyu Park Date: Fri, 2 Mar 2018 10:59:53 +0000 (+0900) Subject: 1.Not perform gbs dashboard build for arch which is specified as 'disable' in meta... X-Git-Tag: submit/trunk/20190927.012743~124 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4d604b40bebd3bd5bdf24d0784894184c2ad3f17;p=services%2Fjenkins-scripts.git 1.Not perform gbs dashboard build for arch which is specified as 'disable' in meta file 2.Remove old build results in gbsdbbuild live repo Change-Id: I7522050f78fcb13bbc93799c88991d9cf762baca --- diff --git a/common/gbsutils.py b/common/gbsutils.py index b1cf688..2b9f6f9 100644 --- a/common/gbsutils.py +++ b/common/gbsutils.py @@ -138,9 +138,14 @@ class GBSBuild: repository = [] arch_list= {} path_prj_list= {} + disable_repo_arch = [] obs_meta_file = prjdir + '/' + obs_prj + '/_meta' lines = open(obs_meta_file).readlines() for line in lines: + if line.find('') != -1: arch_tmp = line.split("")[1].split("")[0] - arch_list[repo_tmp].append(arch_tmp) + if repo_tmp+"##"+arch_tmp not in disable_repo_arch: + arch_list[repo_tmp].append(arch_tmp) if line.find('path project=') != -1: path_prj_arch = line.split('"')[1]+'##'+line.split('"')[3] path_prj_list[repo_tmp].append(path_prj_arch) @@ -460,7 +466,7 @@ class GBSBuild: profile_list=os.listdir(self.build_root+'/local/repos/') for profile in profile_list: - if profile.find(repo) != -1: + if profile.find(repo.replace('-','_')) != -1: profile_path=profile index_file=self.build_root+'/local/repos/'+profile_path+'/'+arch+'/index.html' diff --git a/job_gbsdbbuild_create_snapshot.py b/job_gbsdbbuild_create_snapshot.py index 06398e3..045b63b 100755 --- a/job_gbsdbbuild_create_snapshot.py +++ b/job_gbsdbbuild_create_snapshot.py @@ -319,6 +319,20 @@ def main(): redis_port = int(os.getenv("REDIS_PORT")) backenddb = BackendDB(redis_host, redis_port) + #clear live root except current build_id results + build_id_liverepo = live_repo_base + for subdir in project.split(':'): + if subdir != project.split(':')[-1]: + build_id_liverepo=os.path.join(build_id_liverepo,subdir+':') + else: + build_id_liverepo=os.path.join(build_id_liverepo,subdir) + print "build_id_liverepo = %s" %build_id_liverepo + cmd = 'rm -rf `find '+build_id_liverepo+\ + ' ! -name '+os.path.basename(build_id_liverepo)+\ + ' | grep -v '+gbsbuild_dic['gbsbuild_tag'].split('/')[1]+'`' + print "clear live root command: %s" %cmd + subprocess.call(cmd, stdout=sys.stdout,stderr=sys.stderr, shell=True) + if buildmonitor_enabled: gbs_update_data = {"tag" : gbsbuild_dic['gbsbuild_tag'], "mode" : "snapshot_started"}