summaryrefslogtreecommitdiff
path: root/mason/tests/artifact_upload.py
diff options
context:
space:
mode:
Diffstat (limited to 'mason/tests/artifact_upload.py')
-rw-r--r--mason/tests/artifact_upload.py23
1 files changed, 15 insertions, 8 deletions
diff --git a/mason/tests/artifact_upload.py b/mason/tests/artifact_upload.py
index aa6c56f..62e74e1 100644
--- a/mason/tests/artifact_upload.py
+++ b/mason/tests/artifact_upload.py
@@ -76,14 +76,17 @@ class Runner(mason.runners.JobRunner):
self.log.info('Step 1: Creating a workspace')
self._create_workspace()
- if self.config['upload-build-artifacts']:
- self.log.info('Step 2: Publish the build artifacts')
- self._publish_build_artifacts()
-
- if self.config['upload-release-artifacts']:
- self.log.info('Step %d: Publish the release artifacts' %
- (self.current_step + 1))
- self._publish_release_artifacts()
+ try:
+ if self.config['upload-build-artifacts']:
+ self.log.info('Step 2: Publish the build artifacts')
+ self._publish_build_artifacts()
+
+ if self.config['upload-release-artifacts']:
+ self.log.info('Step %d: Publish the release artifacts' %
+ (self.current_step + 1))
+ self._publish_release_artifacts()
+ except:
+ self._remove_workspace()
self.log.info('Step %d: Clean up' % (self.current_step + 1))
self._clean_up()
@@ -94,6 +97,7 @@ class Runner(mason.runners.JobRunner):
@mason.util.job_step
def _create_workspace(self):
+ os.chdir('/root')
self.commit = self.job_arguments['ZUUL_COMMIT']
self.project = self.job_arguments['ZUUL_PROJECT']
self.ref = self.job_arguments['ZUUL_REF']
@@ -127,4 +131,7 @@ class Runner(mason.runners.JobRunner):
@mason.util.job_step
def _clean_up(self):
+ self._remove_workspace()
+
+ def _remove_workspace(self):
cliapp.runcmd(['rm', '-rf', self.workspace])