fi
# Optional variables
-INSTANCE_START_TIMEOUT="${INSTANCE_START_TIMEOUT:-30}"
+INSTANCE_START_TIMEOUT="${INSTANCE_START_TIMEOUT:-60}"
VM_ARG=()
# Install lxd-client
fail 1 "Unable to find image file for '${OS}' in ${IMAGE_DIRS[@]}"
fi
+if grep -q -E 'XX[A-Za-z0-9_]+XX' "${IMAGE_FILE}" ; then
+ while read -r VAR ; do
+ echo "${VAR}"
+ SHELLVAR=$(echo "${VAR}" | sed 's/^XX//g' | sed 's/XX$//g')
+ set +x
+ sed -i "s/${VAR}/${!SHELLVAR:-VARIABLENOTFOUND}/g" "${IMAGE_FILE}"
+ set -x
+ done < <(grep -E -o 'XX[A-Za-z0-9_]+XX' "${IMAGE_FILE}")
+fi
+
DISTROBUILDER_ARGS=(
distrobuilder
build-incus
rm -rf "${TMP_DIR}"
fi
+# When using `lxc image import` two images cannot have the same alias -
+# only the last image imported will keep the alias. Therefore, the
+# image type is appended as part of the alias.
+IMAGE_NAME="${IMAGE_NAME}/${IMAGE_TYPE}"
lxc image import "${BUILD_DIR}/incus.tar.xz" "${ROOTFS}" --alias="${IMAGE_NAME}" ci:
if [[ "${TEST}" == "true" ]] ; then