-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Nicolas Bock <[email protected]>
- Loading branch information
1 parent
510a665
commit e8ff91f
Showing
1 changed file
with
46 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,46 @@ | ||
#!/bin/bash -eu | ||
juju run octavia-diskimage-retrofit/0 retrofit-image | ||
#!/bin/bash | ||
|
||
set -e -u | ||
|
||
declare amphora_series=jammy | ||
|
||
while (( $# > 0 )); do | ||
case $1 in | ||
-h|--help) | ||
cat <<EOF | ||
Usage: | ||
-h | --help This help | ||
--series SERIES The series (also the image name) to use as the amphora base | ||
EOF | ||
exit | ||
;; | ||
--series) | ||
shift | ||
amphora_series=$1 | ||
;; | ||
*) | ||
echo "unknown option" | ||
exit 1 | ||
;; | ||
esac | ||
shift | ||
done | ||
|
||
basedir=$(realpath $(dirname $0)) | ||
source ${basedir}/../novarc | ||
|
||
ID=$(openstack image show --format value --column id ${amphora_series}) | ||
|
||
TASK=$(juju run octavia-diskimage-retrofit/0 retrofit-image source-image=${ID} --background 2>&1 | grep show-task | sed --regexp-extended 's/^.*task ([0-9]+).*/\1/') | ||
|
||
echo -n "Running retrofit" | ||
while [[ $(juju show-task ${TASK}) =~ running ]]; do | ||
echo -n . | ||
sleep 5 | ||
done | ||
echo | ||
|
||
ID=$(openstack image list --format json | jq --raw-output '.[] | select(.Name | match("amphora")) | .ID') | ||
|
||
openstack image set --tag octavia-amphora ${ID} |