test: Replace API calling with composer-cli

composer-cli-28.14.58 is in nightly compose of RHEL 8.4, it's time
to replace API calling with composer-cli
This commit is contained in:
Xiaofeng Wang 2021-04-07 10:32:15 +08:00 committed by Achilleas Koutsou
parent 54a458af5c
commit 87921f0319

View file

@ -118,23 +118,9 @@ build_image() {
greenprint "🚀 Starting compose"
if [ $# -eq 3 ]; then
repo_url=$3
sudo curl --silent --header "Content-Type: application/json" --unix-socket /run/weldr/api.socket http://localhost/api/v1/compose --data "{
\"blueprint_name\": \"$blueprint_name\",
\"compose_type\": \"$image_type\",
\"ostree\": {
\"url\": \"$repo_url\",
\"ref\": \"$OSTREE_REF\"
}
}" | tee "$COMPOSE_START"
sudo composer-cli --json compose start-ostree --ref "$OSTREE_REF" --url "$repo_url" "$blueprint_name" "$image_type" | tee "$COMPOSE_START"
else
# Test ref begining with /
sudo curl --silent --header "Content-Type: application/json" --unix-socket /run/weldr/api.socket http://localhost/api/v1/compose --data "{
\"blueprint_name\": \"$blueprint_name\",
\"compose_type\": \"$image_type\",
\"ostree\": {
\"ref\": \"$OSTREE_REF\"
}
}" | tee "$COMPOSE_START"
sudo composer-cli --json compose start-ostree "$blueprint_name" "$image_type" | tee "$COMPOSE_START"
fi
COMPOSE_ID=$(jq -r '.build_id' "$COMPOSE_START")