b9-1.1.0: A tool and library for building virtual machine images.

Safe HaskellNone
LanguageHaskell2010

B9.DiskImageBuilder

Description

Effectful functions that create and convert disk image files.

Synopsis

Documentation

materializeImageSource :: IsB9 e => ImageSource -> Image -> Eff e () Source #

Create an image from an image source. The destination image must have a compatible image type and filesystem. The directory of the image MUST be present and the image file itself MUST NOT alredy exist.

substImageTarget :: forall e. (HasCallStack, Member EnvironmentReader e, Member ExcB9 e) => ImageTarget -> Eff e ImageTarget Source #

Replace $... variables inside an ImageTarget

preferredDestImageTypes :: IsB9 e => ImageSource -> Eff e [ImageType] Source #

Return all valid image types sorted by preference.

preferredSourceImageTypes :: HasCallStack => ImageDestination -> [ImageType] Source #

Return all supported source ImageTypes compatible to a ImageDestinaion in the preferred order.

resolveImageSource :: IsB9 e => ImageSource -> Eff e Image Source #

Resolve an ImageSource to an Image. The ImageSource might not exist, as is the case for EmptyImage.

createDestinationImage :: IsB9 e => Image -> ImageDestination -> Eff e () Source #

Convert some Image, e.g. a temporary image used during the build phase to the final destination.

resizeImage :: IsB9 e => ImageResize -> Image -> Eff e () Source #

Resize an image, including the file system inside the image.

importImage :: IsB9 e => Image -> Image -> Eff e () Source #

Import a disk image from some external source into the build directory if necessary convert the image.

exportImage :: IsB9 e => Image -> Image -> Eff e () Source #

Export a disk image from the build directory; if necessary convert the image.

exportAndRemoveImage :: IsB9 e => Image -> Image -> Eff e () Source #

Export a disk image from the build directory; if necessary convert the image.

convertImage :: IsB9 e => Image -> Image -> Eff e () Source #

Convert an image in the build directory to another format and return the new image.

shareImage :: IsB9 e => Image -> SharedImageName -> Eff e SharedImage Source #

Publish an sharedImage made from an image and image meta data to the configured repository

ensureAbsoluteImageDirExists :: IsB9 e => Image -> Eff e Image Source #

Create the parent directories for the file that contains the Image. If the path to the image file is relative, prepend _projectRoot from the B9Config.