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

Safe HaskellNone



Effectful functions that create and convert disk image files.



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.

pushSharedImageLatestVersion :: IsB9 e => SharedImageName -> Eff e () Source #

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

lookupSharedImages :: IsB9 e => (Repository -> Bool) -> (SharedImage -> Bool) -> Eff e [(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 :: IsB9 e => Eff e [(Repository, [SharedImage])] Source #

Return a list of all existing sharedImages from cached repositories.

getSharedImagesCacheDir :: IsB9 e => Eff e FilePath Source #

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

getSelectedRepos :: IsB9 e => Eff e [RemoteRepo] Source #

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

pullRemoteRepos :: IsB9 e => Eff e () Source #

Pull metadata files from all remote repositories.

pullLatestImage :: IsB9 e => SharedImageName -> Eff e (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.