From a623fc8a29123a98bec287bd6f15db853565066a Mon Sep 17 00:00:00 2001 From: Junghyun Kim Date: Wed, 11 Jan 2017 15:01:05 +0900 Subject: [PATCH] Change directory order from "bp_id/proj_name" to "proj_name/bp_id" This is more readable and it is better way to support the distributed infrastructure environment. Change-Id: I3420631af2bc3943fe0051aa8df25ed254472b82 Signed-off-by: Junghyun Kim --- job_make_dep_graph.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/job_make_dep_graph.py b/job_make_dep_graph.py index ca5fd19..cad7bca 100644 --- a/job_make_dep_graph.py +++ b/job_make_dep_graph.py @@ -38,10 +38,11 @@ class LocalError(Exception): def create_build_progress_dep_graph(build, obs_project, content): sync_out_dir = os.path.join(os.getenv('WORKSPACE'), 'outdir') - sync_dest = os.path.join(os.getenv('IMG_SYNC_DEST_BASE'), + sync_dest_parent = os.path.join(os.getenv('IMG_SYNC_DEST_BASE'), ".dep_graph", - content.get("build_project_id"), obs_project) + sync_dest = os.path.join(sync_dest_parent, + content.get("build_project_id")) print "sync_dest = %s" % sync_dest @@ -54,11 +55,11 @@ def create_build_progress_dep_graph(build, obs_project, content): ".dep_graph")) sync(sync_out_dir, os.path.join(os.getenv('IMG_SYNC_DEST_BASE'), - ".dep_graph", content.get("build_project_id"))) + ".dep_graph", obs_project)) sync(sync_out_dir, os.path.join(os.getenv('IMG_SYNC_DEST_BASE'), - ".dep_graph", content.get("build_project_id"), - obs_project)) + ".dep_graph", obs_project, + content.get("build_project_id"))) # copy vis and dep_graph dirs. vis_dir = os.path.join(os.getenv("WORKSPACE"), "jenkins-scripts/vis") @@ -110,6 +111,13 @@ def create_build_progress_dep_graph(build, obs_project, content): # sync to donwload server sync(sync_out_dir, sync_dest) + # sync latest link + latest_parent = os.path.join(sync_out_dir, "link") + os.makedirs(latest_parent) + latest = os.path.join(latest_parent, "latest") + os.symlink(content.get("build_project_id"), latest) + sync(latest_parent, sync_dest_parent) + def create_build_progress_dep_graph_post(build, obs_project, backenddb, content): print "creating build_progress_dep_graph..." -- 2.7.4