summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2014-07-30 16:57:16 (GMT)
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2014-07-30 17:20:18 (GMT)
commit389b259fb586454c3dc447613545c280d512fc51 (patch)
treedd6afb827489c93724d6d08d2fe2ce4cfdcf2d86
parent497334fd9c0190437cefa9f089537be0556e3d2d (diff)
downloaddefinitions-389b259fb586454c3dc447613545c280d512fc51.tar.gz
Refactor process_args to be clearer
Move stuff into new methods to make overall logic clearer and to avoid stuffing too much into each method.
-rwxr-xr-xscripts/release-upload23
1 files changed, 14 insertions, 9 deletions
diff --git a/scripts/release-upload b/scripts/release-upload
index 68de800..cfbe06b 100755
--- a/scripts/release-upload
+++ b/scripts/release-upload
@@ -153,18 +153,23 @@ class ReleaseUploader(cliapp.Application):
def process_args(self, args):
self.status(msg='Uploading and publishing Baserock release')
- BuildArtifactPublisher(self.settings,
- self.status).publish_build_artifacts()
- self.status(msg='Build artifiacts have been published')
-
+ self.publish_build_artifacts()
if self.settings['upload-release-artifacts']:
- ReleaseArtifactPublisher(self.settings,
- self.status).publish_release_artifacts()
- self.status(msg='Release images have been published')
+ self.publish_release_artifacts()
else:
self.status(
- msg=('Not uploading release artifacts '
- '(--upload-release-artifacts not set)'))
+ msg='Not uploading release artifacts '
+ '(upload-release-artifacts set to false')
+
+ def publish_build_artifacts(self):
+ publisher = BuildArtifactPublisher(self.settings, self.status)
+ publisher.publish_build_artifacts()
+ self.status(msg='Build artifacts have been published')
+
+ def publish_release_artifacts(self):
+ publisher = ReleaseArtifactPublisher(self.settings, self.status)
+ publisher.publish_release_artifacts()
+ self.status(msg='Release artifacts have been published')
def status(self, msg, **kwargs):
formatted = msg.format(**kwargs)