test/ostree: support weldr-client output structure
This commit is contained in:
parent
e6cff1c59a
commit
c8032c7bbc
1 changed files with 11 additions and 2 deletions
|
|
@ -53,6 +53,15 @@ function greenprint {
|
||||||
echo -e "\033[1;32m${1}\033[0m"
|
echo -e "\033[1;32m${1}\033[0m"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_build_info() {
|
||||||
|
key="$1"
|
||||||
|
fname="$2"
|
||||||
|
if rpm -q --quiet weldr-client; then
|
||||||
|
key=".body${key}"
|
||||||
|
fi
|
||||||
|
jq -r "${key}" "${fname}"
|
||||||
|
}
|
||||||
|
|
||||||
# Start libvirtd and test it.
|
# Start libvirtd and test it.
|
||||||
greenprint "🚀 Starting libvirt daemon"
|
greenprint "🚀 Starting libvirt daemon"
|
||||||
sudo systemctl start libvirtd
|
sudo systemctl start libvirtd
|
||||||
|
|
@ -170,13 +179,13 @@ build_image() {
|
||||||
else
|
else
|
||||||
sudo composer-cli --json compose start "$blueprint_name" $IMAGE_TYPE | tee "$COMPOSE_START"
|
sudo composer-cli --json compose start "$blueprint_name" $IMAGE_TYPE | tee "$COMPOSE_START"
|
||||||
fi
|
fi
|
||||||
COMPOSE_ID=$(jq -r '.build_id' "$COMPOSE_START")
|
COMPOSE_ID=$(get_build_info ".build_id" "$COMPOSE_START")
|
||||||
|
|
||||||
# Wait for the compose to finish.
|
# Wait for the compose to finish.
|
||||||
greenprint "⏱ Waiting for compose to finish: ${COMPOSE_ID}"
|
greenprint "⏱ Waiting for compose to finish: ${COMPOSE_ID}"
|
||||||
while true; do
|
while true; do
|
||||||
sudo composer-cli --json compose info "${COMPOSE_ID}" | tee "$COMPOSE_INFO" > /dev/null
|
sudo composer-cli --json compose info "${COMPOSE_ID}" | tee "$COMPOSE_INFO" > /dev/null
|
||||||
COMPOSE_STATUS=$(jq -r '.queue_status' "$COMPOSE_INFO")
|
COMPOSE_STATUS=$(get_build_info ".queue_status" "$COMPOSE_INFO")
|
||||||
|
|
||||||
# Is the compose finished?
|
# Is the compose finished?
|
||||||
if [[ $COMPOSE_STATUS != RUNNING ]] && [[ $COMPOSE_STATUS != WAITING ]]; then
|
if [[ $COMPOSE_STATUS != RUNNING ]] && [[ $COMPOSE_STATUS != WAITING ]]; then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue