-
-
Save BlackDex/b02e3ae7ec1728c1de76dd1f9e583157 to your computer and use it in GitHub Desktop.
Upgrade Openstack deployed with Juju Charm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -eu | |
# | |
# Trigger a managed upgrade. | |
# | |
# Authors: | |
# edward.hope-morley@canonical.com | |
# | |
SERVICE=$1 | |
RELEASE=$2 | |
SERIES=${3:-'trusty'} | |
units () | |
{ | |
cat << EOF| python - | |
import json, subprocess | |
data = subprocess.check_output(['juju', 'status', '--format=json']) | |
j = json.loads(data) | |
services = j['services'] | |
print '\n'.join(services["$1"]['units'].keys()) | |
EOF | |
} | |
juju set $SERVICE action-managed-upgrade=True openstack-origin="cloud:$SERIES-$RELEASE" | |
for unit in `units $SERVICE`; do | |
echo -e "\033[32mUpgrading unit \033[33m$unit\033[32m to \033[33mcloud:$SERIES-$RELEASE\033[0m" | |
juju action do $unit openstack-upgrade | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment