diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-02-17 13:31:47 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-03-04 14:47:24 +0000 |
commit | ed12e753b439a67d73be62fdc86984c16b9ca546 (patch) | |
tree | 9bcbce12254131f268a60515d8ada7960e93a03f /ssh-rsync.write | |
parent | 836adbd2560abfac62ee106f0e92d048f5e810c6 (diff) | |
download | definitions-ed12e753b439a67d73be62fdc86984c16b9ca546.tar.gz |
deploy: Honour AUTOSTART in ssh-rsync extension
Now you can deploy an upgrade, set it to be the default version and reboot
into it all with one call to `morph deploy`.
Diffstat (limited to 'ssh-rsync.write')
-rwxr-xr-x | ssh-rsync.write | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ssh-rsync.write b/ssh-rsync.write index 8dc0fe35..509520ae 100755 --- a/ssh-rsync.write +++ b/ssh-rsync.write @@ -59,6 +59,7 @@ class SshRsyncWriteExtension(morphlib.writeexts.WriteExtension): root_disk = self.find_root_disk(location) version_label = os.environ.get('VERSION_LABEL') + autostart = self.get_environment_boolean('AUTOSTART') self.status(msg='Creating remote mount point') remote_mnt = cliapp.ssh_runcmd(location, ['mktemp', '-d']).strip() @@ -110,6 +111,10 @@ class SshRsyncWriteExtension(morphlib.writeexts.WriteExtension): cliapp.ssh_runcmd(location, ['umount', remote_mnt]) cliapp.ssh_runcmd(location, ['rmdir', remote_mnt]) + if autostart: + self.status(msg="Rebooting into new system ...") + ssh_runcmd_ignore_failure(location, ['reboot']) + def create_remote_orig(self, location, version_root, remote_mnt, temp_root): '''Create the subvolume version_root/orig on location''' |