summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2016-12-01 19:06:56 +0200
committerYaroslav Brustinov <ybrustin@cisco.com>2016-12-01 19:06:56 +0200
commit46385db3eba26ce6c997f7558b274203edc2377b (patch)
tree6482c3d512bbed2bf2d9930a8805cef7470f050d
parent6fccfd91b566d11324290ab50ab46677c99e6362 (diff)
docs: add publish_perf option, refactor other publishes
Change-Id: I6e9e3d8f77990fe2d9f300b5d6d0afb01a12d403 Signed-off-by: Yaroslav Brustinov <ybrustin@cisco.com>
-rwxr-xr-xdoc/ws_main.py47
-rwxr-xr-xdoc/wscript3
2 files changed, 44 insertions, 6 deletions
diff --git a/doc/ws_main.py b/doc/ws_main.py
index c5ccf205..9ba1d295 100755
--- a/doc/ws_main.py
+++ b/doc/ws_main.py
@@ -1076,16 +1076,51 @@ def release(bld):
os.system('cp -rv build/release_notes.* '+ release_dir)
+def rsync_int(bld, src, dst):
+ cmd = 'rsync -av --del --rsh=ssh build/{src} {host}:{dir}/{dst}'.format(
+ src = src,
+ host = Env().get_local_web_server(),
+ dir = Env().get_remote_release_path() + '../doc',
+ dst = dst)
+ ret = os.system(cmd)
+ if ret:
+ bld.fatal("cmd '%s' exited with return status" % (cmd, ret))
+
+
+def rsync_ext(bld, src, dst):
+ cmd = 'rsync -avz --del -e "ssh -i {key}" --rsync-path=/usr/bin/rsync build/{src} {user}@{host}:{dir}/doc/{dst}'.format(
+ key = Env().get_trex_ex_web_key(),
+ src = src,
+ user = Env().get_trex_ex_web_user(),
+ host = Env().get_trex_ex_web_srv(),
+ dir = Env().get_trex_ex_web_path(),
+ dst = dst)
+ ret = os.system(cmd)
+ if ret:
+ bld.fatal("cmd '%s' exited with return status" % (cmd, ret))
+
+
def publish(bld):
- # copy all the files to our web server
- remote_dir = "%s:%s" % ( Env().get_local_web_server(), Env().get_remote_release_path ()+'../doc/')
- os.system('rsync -av --del --rsh=ssh build/ %s' % (remote_dir))
+ # copy all the files to internal web server
+ rsync_int(bld, '', '')
def publish_ext(bld):
- from_ = 'build/'
- os.system('rsync -avz --del -e "ssh -i %s" --rsync-path=/usr/bin/rsync %s %s@%s:%s/doc/' % (Env().get_trex_ex_web_key(),from_, Env().get_trex_ex_web_user(),Env().get_trex_ex_web_srv(),Env().get_trex_ex_web_path() ) )
-
+ # copy all the files to external web server
+ rsync_ext(bld, '', '')
+
+
+def publish_perf(bld):
+ # copy performance files to internal and external servers
+ rsync_int(bld, 'trex_analytics.html', '')
+ rsync_ext(bld, 'trex_analytics.html', '')
+ rsync_int(bld, 'images/*_latest_test_*', 'images/')
+ rsync_ext(bld, 'images/*_latest_test_*', 'images/')
+ rsync_int(bld, 'images/*_trend_graph.*', 'images/')
+ rsync_ext(bld, 'images/*_trend_graph.*', 'images/')
+ rsync_int(bld, 'images/*_trend_stats.*', 'images/')
+ rsync_ext(bld, 'images/*_trend_stats.*', 'images/')
+
def publish_test(bld):
# copy all the files to our web server
diff --git a/doc/wscript b/doc/wscript
index 187a5528..f574e69b 100755
--- a/doc/wscript
+++ b/doc/wscript
@@ -52,6 +52,9 @@ def publish_ext(bld):
def publish_web(bld):
ws_main.publish_web(bld)
+def publish_perf(bld):
+ ws_main.publish_perf(bld)
+
def sync(bld):
ws_main.sync(bld)