summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Hesketh <josh@nitrotech.org>2014-01-22 15:04:54 +1100
committerJoshua Hesketh <josh@nitrotech.org>2014-01-22 15:04:54 +1100
commit6055f3187c989a1d4c46a9400084a3347f38c847 (patch)
treed3fea856dafbea660e12da2f0da9661ff0039e20
parent5a2edd4767992eaaae87e72c25546f0d2aa52e3b (diff)
downloadturbo-hipster-6055f3187c989a1d4c46a9400084a3347f38c847.tar.gz
Add results uploader to generic ShellTask
Change-Id: I2ed0269bf6b47b13a001774a441b94a4746103f1
-rw-r--r--turbo_hipster/lib/models.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/turbo_hipster/lib/models.py b/turbo_hipster/lib/models.py
index d4a2738..59ed786 100644
--- a/turbo_hipster/lib/models.py
+++ b/turbo_hipster/lib/models.py
@@ -173,11 +173,14 @@ class ShellTask(Task):
@common.task_step
def _prep_working_dir(self):
+ self.results_set_name = utils.determine_job_identifier(
+ self.job_arguments,
+ self.plugin_config['function'],
+ self.job.unique
+ )
self.job_working_dir = os.path.join(
self.global_config['jobs_working_dir'],
- utils.determine_job_identifier(self.job_arguments,
- self.plugin_config['function'],
- self.job.unique)
+ self.results_set_name
)
self.shell_output_log = os.path.join(
self.job_working_dir,
@@ -213,4 +216,11 @@ class ShellTask(Task):
@common.task_step
def _handle_results(self):
- pass
+ """Upload the contents of the working dir either using the instructions
+ provided by zuul and/or our configuration"""
+ self.log.debug("Process the resulting files (upload/push)")
+ index_url = utils.push_file(self.results_set_name,
+ self.job_working_dir,
+ self.global_config['publish_logs'])
+ self.log.debug("Index URL found at %s" % index_url)
+ self.work_data['url'] = index_url