summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2014-07-02 09:54:27 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2014-07-02 09:54:45 +0000
commit4189625ac0ed5f04e9dc63bd5d603dd63782fa1b (patch)
treec79f5afccca954bc9afd4a49fc5cdd8d505e7c69 /scripts
parent2b60b3c7a054e6e839014bb4ea7f33b42b195879 (diff)
downloaddefinitions-4189625ac0ed5f04e9dc63bd5d603dd63782fa1b.tar.gz
do-release: Check access to configured upload servers when script starts
If the release script is expected to be 'push-button' then we can't assume the user will be paying attention to error messages later on.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/do-release.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/do-release.py b/scripts/do-release.py
index ad34dc3e..5c4fff04 100644
--- a/scripts/do-release.py
+++ b/scripts/do-release.py
@@ -538,9 +538,23 @@ class Upload(object):
cliapp.ssh_runcmd(server, ['rm', remote_artifacts_tar])
+def check_ssh_access(server):
+ status('Checking for access to server %s', server)
+
+ try:
+ cliapp.ssh_runcmd(server, ['true'])
+ except cliapp.AppException as e:
+ logging.debug('Got exception: %s', e)
+ raise cliapp.AppException(
+ 'Couldn\'t connect to configured remote server %s' % server)
+
+
def main():
logging.basicConfig(level=logging.INFO)
+ check_ssh_access(config.images_server)
+ check_ssh_access(config.artifacts_server)
+
deploy_images = DeployImages()
outputs = deploy_images.run()