b9-0.3.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 :: ImageSource -> Image -> B9 () Source

Create an image from an image source. The destination image must have a compatible image type and filesyste. 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.

resolveImageSource :: ImageSource -> B9 Image Source

Resolve an ImageSource to an Image. Note however that this source will may not exist as is the case for EmptyImage.

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

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.

pullRemoteRepos :: B9 () Source

Pull metadata files from all remote repositories.

pullLatestImage :: SharedImageName -> B9 Bool Source

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