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

Safe HaskellNone
LanguageHaskell2010

B9.RepositoryIO

Description

Effectful functions executing shared image respository operations. See B9.Repository

Synopsis

Documentation

repoSearch :: forall e. (CommandIO e, Member RepoCacheReader e) => FilePath -> FilePathGlob -> Eff e [(Repository, [FilePath])] Source #

Find files which are in subDir and match glob in the repository cache. NOTE: This operates on the repository cache, but does not enforce a repository cache update.

pushToRepo :: (Member ExcB9 e, CommandIO e) => RemoteRepo -> FilePath -> FilePath -> Eff e () Source #

Push a file from the cache to a remote repository

pullFromRepo :: (Member ExcB9 e, CommandIO e) => RemoteRepo -> FilePath -> FilePath -> Eff e () Source #

Pull a file from a remote repository to cache

withRemoteRepos :: (Member B9ConfigReader e, Lifted IO e) => Eff (RepoCacheReader ': e) a -> Eff e a Source #

Initialize the local repository cache directory and the RemoteRepos. Run the given action with a B9Config that contains the initialized repositories in _remoteRepos.

Since: 0.5.65

pullGlob :: (Member ExcB9 e, CommandIO e, Member RepoCacheReader e) => FilePath -> FilePathGlob -> RemoteRepo -> Eff e () Source #

Push a file from the cache to a remote repository

newtype FilePathGlob Source #

Express a pattern for file paths, used when searching repositories.

Constructors

FileExtension String 

getSharedImages :: (HasCallStack, CommandIO e, Lifted IO e, Member RepoCacheReader e) => Eff e (Map Repository (Set SharedImage)) Source #

Return a list of all existing sharedImages from cached repositories.

getSharedImagesCacheDir :: '[RepoCacheReader] <:: e => Eff e FilePath Source #

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

getSelectedRepos :: '[B9ConfigReader, SelectedRemoteRepoReader] <:: e => Eff e [RemoteRepo] Source #

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

pullRemoteRepos :: (HasCallStack, Member ExcB9 e, Lifted IO e, CommandIO e, '[SelectedRemoteRepoReader, RepoCacheReader] <:: e) => Eff e () Source #

Pull metadata files from all remote repositories.

pullLatestImage :: (HasCallStack, Lifted IO e, CommandIO e, '[ExcB9, RepoCacheReader, SelectedRemoteRepoReader] <:: 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.

cleanOldSharedImageRevisionsFromCache :: ('[RepoCacheReader, ExcB9] <:: e, Lifted IO e, CommandIO e) => SharedImageName -> Eff e () Source #

Depending on the maxLocalSharedImageRevisions B9Config settings either do nothing or delete all but the configured number of most recent shared images with the given name from the local cache.

cleanLocalRepoCache :: ('[RepoCacheReader, ExcB9] <:: e, Lifted IO e, CommandIO e) => Eff e () Source #

Clean all obsolete images in the local image cache.

Since: 1.1.0

pushToSelectedRepo :: (Member ExcB9 e, Lifted IO e, CommandIO e, '[RepoCacheReader, SelectedRemoteRepoReader] <:: e) => SharedImage -> Eff e () Source #

Upload a shared image from the cache to a selected remote repository

pushSharedImageLatestVersion :: (Lifted IO e, CommandIO e, '[SelectedRemoteRepoReader, RepoCacheReader, ExcB9] <:: e) => SharedImageName -> Eff e () Source #

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

getLatestImageByName :: (HasCallStack, Lifted IO e, CommandIO e, Member RepoCacheReader e) => SharedImageName -> Eff e (Maybe Image) Source #

Return the Image of the latest version of a shared image named name from the local cache.

cleanRemoteRepo :: MonadIO m => RepoCache -> RemoteRepo -> m () Source #

Empty the repository; load the corresponding settings from the config file, check that the priv key exists and create the correspondig cache directory.

remoteRepoCheckSshPrivKey :: MonadIO m => RemoteRepo -> m RemoteRepo Source #

Check for existance of priv-key and make it an absolute path.