summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2015-07-17 10:03:54 +0300
committerLars Wirzenius <liw@liw.fi>2015-07-17 10:03:54 +0300
commit0e13497c9cd05e19666af54047c125cf1142b242 (patch)
tree8005250c7f4131a5784efb30477aace09f7b38fa
parent65f591183c2550566637c8a599caedda1944f0cf (diff)
downloadobnam-benchmarks-0e13497c9cd05e19666af54047c125cf1142b242.tar.gz
Add publish_html to spec files
-rwxr-xr-xobbench8
-rw-r--r--production.yaml2
-rw-r--r--test.yaml1
3 files changed, 11 insertions, 0 deletions
diff --git a/obbench b/obbench
index bee6a20..1c802e9 100755
--- a/obbench
+++ b/obbench
@@ -190,6 +190,7 @@ class ObnamBenchmarker(cliapp.Application):
self.write_benchmark_page(spec, obj)
self.write_summary_page(spec, objs)
self.copy_css_file(spec)
+ self.publish_html(spec)
def read_results_files(self, spec):
objs = []
@@ -355,6 +356,13 @@ class ObnamBenchmarker(cliapp.Application):
filename = os.path.join(spec['html_dir'], 'benchmark.css')
shutil.copy('benchmark.css', filename)
+ def publish_html(self, spec):
+ if 'publish_html' in spec:
+ self.logger.msg('Publishing HTML')
+ cliapp.runcmd(
+ ['sh', '-euc', spec['publish_html']],
+ cwd=spec['html_dir'])
+
class BenchmarkResult(object):
diff --git a/production.yaml b/production.yaml
index 38d6ee7..550e717 100644
--- a/production.yaml
+++ b/production.yaml
@@ -18,3 +18,5 @@ benchmarks:
- obnam: restore
reports_dir: /home/liw/benchmark/reports
html_dir: /home/liw/benchmark/html
+publish_html: |
+ rsync -ahHSs --delete-after "$HOME/benchmark/." obbench@pieni.net:benchmark/.
diff --git a/test.yaml b/test.yaml
index b65ea67..72ece83 100644
--- a/test.yaml
+++ b/test.yaml
@@ -17,4 +17,5 @@ benchmarks:
- obnam: backup
reports_dir: /home/liw/obnam/benchmarks/reports
html_dir: /home/liw/obnam/benchmarks/html
+publish_html: echo PUBLISHING HTML HERE
state: /home/liw/obnam/benchmarks/state.yaml