From 822a1457660a6b46d5f8c5ab8b28efeb8cb51b59 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Wed, 30 Jul 2014 14:55:57 +0100 Subject: Allow release-upload to be configured not to upload release images For continuous artifact cache population, we don't care so much about the large disk images that we make available at release time. This patch allows omitting any of the configuration required to upload the release images to mean that we didn't want to upload them, and continue without doing so. --- scripts/release-upload | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/release-upload b/scripts/release-upload index 2e7f54e8..e7367f13 100755 --- a/scripts/release-upload +++ b/scripts/release-upload @@ -140,9 +140,27 @@ 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() - ReleaseArtifactPublisher(self.settings, self.status).publish_release_artifacts() - self.status(msg='Release has been uploaded and published') + BuildArtifactPublisher(self.settings, + self.status).publish_build_artifacts() + self.status(msg='Build artifiacts have been published') + + RELEASE_OPTIONS = ('release-artifact-dir', + 'download-server-username', + 'download-server-address', + 'download-server-private-dir', + 'download-server-public-dir') + missing_options = set(option for option in RELEASE_OPTIONS + if self.settings[option] == '') + + if not missing_options: + ReleaseArtifactPublisher(self.settings, + self.status).publish_release_artifacts() + self.status(msg='Release images have been published') + else: + self.status(msg='Not uploading release images: ' + 'options not provided: {options}', + options=', '.join(missing_options)) + def status(self, msg, **kwargs): formatted = msg.format(**kwargs) -- cgit v1.2.1