b9-0.5.48: 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 :: ImageSource -> Image -> B9 () 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 :: [(String, String)] -> ImageTarget -> ImageTarget Source #

Replace $... variables inside an ImageTarget

preferredDestImageTypes :: ImageSource -> B9 [ImageType] Source #

Return all valid image types sorted by preference.

preferredSourceImageTypes :: ImageDestination -> [ImageType] Source #

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

resolveImageSource :: ImageSource -> B9 Image Source #

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

createDestinationImage :: Image -> ImageDestination -> B9 () Source #

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

resizeImage :: ImageResize -> Image -> B9 () Source #

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

importImage :: Image -> Image -> B9 () Source #

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

exportImage :: Image -> Image -> B9 () Source #

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

exportAndRemoveImage :: Image -> Image -> B9 () Source #

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

convertImage :: Image -> Image -> B9 () Source #

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

shareImage :: Image -> SharedImageName -> B9 SharedImage Source #

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

ensureAbsoluteImageDirExists :: Image -> B9 Image Source #

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

pushSharedImageLatestVersion :: SharedImageName -> B9 () Source #

Publish the latest version of a shared image identified by name to the selected repository from the cache.

lookupSharedImages :: (Repository -> Bool) -> (SharedImage -> Bool) -> B9 [(Repository, SharedImage)] Source #

Find shared images and the associated repos from two predicates. The result is the concatenated result of the sorted shared images satisfying imgPred.

getSharedImages :: B9 [(Repository, [SharedImage])] Source #

Return a list of all existing sharedImages from cached repositories.

getSharedImagesCacheDir :: B9 FilePath Source #

Return the path to the sub directory in the cache that contains files of shared images.

getSelectedRepos :: B9 [RemoteRepo] Source #

Return either all remote repos or just the single selected repo.

pullRemoteRepos :: B9 () Source #

Pull metadata files from all remote repositories.

pullLatestImage :: SharedImageName -> B9 (Maybe SharedImageBuildId) Source #

Pull the latest version of an image, either from the selected remote repo or from the repo that has the latest version.