Make sure the brand-id is properly selected, allow channel overrides.

appliance-channel
Łukasz 'sil2100' Zemczak 5 years ago
parent 8e70f5e2a5
commit 4769d734b2

@ -356,6 +356,7 @@ case $IMAGEFORMAT in
if [ $PROJECT = "ubuntu-core" ]; then if [ $PROJECT = "ubuntu-core" ]; then
# snap-based core images # snap-based core images
BRAND="canonical"
CHANNEL="${CHANNEL:-edge}" CHANNEL="${CHANNEL:-edge}"
case $MODEL in case $MODEL in
pc-amd64|pc-i386) pc-amd64|pc-i386)
@ -381,8 +382,16 @@ case $IMAGEFORMAT in
# Ubuntu Core 18 # Ubuntu Core 18
MODEL="ubuntu-core-18-${MODEL#pc-}" MODEL="ubuntu-core-18-${MODEL#pc-}"
case $CHANNEL in case $CHANNEL in
appliance*) # Support a special-case channel for appliance images
appliance-*)
# Allow overriding the stability level for appliances
CHANNEL="${CHANNEL#appliance-}"
BRAND="ubuntu"
;;
appliance)
# Default appliance image
CHANNEL="stable" CHANNEL="stable"
BRAND="ubuntu"
;; ;;
esac esac
UBUNTU_IMAGE_ARGS="$UBUNTU_IMAGE_ARGS -c $CHANNEL" UBUNTU_IMAGE_ARGS="$UBUNTU_IMAGE_ARGS -c $CHANNEL"
@ -430,7 +439,7 @@ case $IMAGEFORMAT in
echo "IMAGEFORMAT=$IMAGEFORMAT" >> config/common echo "IMAGEFORMAT=$IMAGEFORMAT" >> config/common
echo "UBUNTU_IMAGE_ARGS=\"$UBUNTU_IMAGE_ARGS\"" >> config/common echo "UBUNTU_IMAGE_ARGS=\"$UBUNTU_IMAGE_ARGS\"" >> config/common
# Store model assertion in top dir to get it picked up later as a build artifact # Store model assertion in top dir to get it picked up later as a build artifact
env SNAPPY_STORE_NO_CDN=1 snap known --remote model series=16 model="$MODEL" brand-id=canonical > "$PREFIX".model-assertion env SNAPPY_STORE_NO_CDN=1 snap known --remote model series=16 model="$MODEL" brand-id=$BRAND > "$PREFIX".model-assertion
echo "Configured ubuntu-image for the following model assertion:" echo "Configured ubuntu-image for the following model assertion:"
cat "$PREFIX".model-assertion cat "$PREFIX".model-assertion
echo "----------------------------------------------------------" echo "----------------------------------------------------------"

Loading…
Cancel
Save