Safe Haskell | None |
---|---|
Language | Haskell2010 |
Mostly effectful functions to assemble artifacts.
Synopsis
- buildArtifacts :: ArtifactGenerator -> B9 String
- getArtifactOutputFiles :: ArtifactGenerator -> Either String [FilePath]
- assemble :: ArtifactGenerator -> B9 [AssembledArtifact]
- evalArtifactGenerator :: String -> String -> BuildVariables -> ArtifactGenerator -> Either String [InstanceGenerator [SourceGenerator]]
- parseArtifactGenerator :: ArtifactGenerator -> CGParser ()
- withArtifactSources :: [ArtifactSource] -> CGParser () -> CGParser ()
- withBindings :: [(String, String)] -> CGParser () -> CGParser ()
- addBindings :: [(String, String)] -> CGEnv -> CGEnv
- withXBindings :: [(String, [String])] -> CGParser () -> CGParser ()
- eachBindingSetT :: ArtifactGenerator -> [String] -> [[String]] -> CGParser [[(String, String)]]
- eachBindingSet :: ArtifactGenerator -> [(String, [String])] -> CGParser [[(String, String)]]
- writeInstanceGenerator :: InstanceId -> ArtifactAssembly -> CGParser ()
- newtype CGParser a = CGParser {
- runCGParser :: WriterT [InstanceGenerator CGEnv] (ReaderT CGEnv (Either CGError)) a
- data CGEnv = CGEnv {
- agEnv :: [(String, String)]
- agSources :: [ArtifactSource]
- data InstanceGenerator e = IG InstanceId e ArtifactAssembly
- newtype CGError = CGError String
- cgError :: String -> CGParser a
- execCGParser :: CGParser () -> CGEnv -> Either CGError [InstanceGenerator CGEnv]
- execIGEnv :: InstanceGenerator CGEnv -> Either String (InstanceGenerator [SourceGenerator])
- substAssembly :: [(String, String)] -> ArtifactAssembly -> ArtifactAssembly
- toSourceGen :: [(String, String)] -> ArtifactSource -> Either String [SourceGenerator]
- createAssembledArtifacts :: [InstanceGenerator [SourceGenerator]] -> B9 [AssembledArtifact]
- generateSources :: FilePath -> InstanceGenerator [SourceGenerator] -> B9 (InstanceGenerator FilePath)
- createTargets :: InstanceGenerator FilePath -> B9 AssembledArtifact
- generateUniqueIID :: InstanceId -> B9 InstanceId
- generateSourceTo :: FilePath -> SourceGenerator -> B9 ()
- sgReadSourceFile :: [(String, String)] -> SourceFile -> B9 ByteString
- sgChangePerm :: FilePath -> SGPerm -> B9 ()
- data SourceGenerator = SG [(String, String)] SGSource SGPerm FilePath
- sourceGeneratorOutputFile :: SourceGenerator -> FilePath
- data SGSource
- data SGPerm
- sgGetFroms :: SourceGenerator -> [SourceFile]
- setSGPerm :: Int -> Int -> Int -> SourceGenerator -> Either String SourceGenerator
- setSGFromDirectory :: FilePath -> SourceGenerator -> SourceGenerator
- setSGToDirectory :: FilePath -> SourceGenerator -> SourceGenerator
- createTarget :: InstanceId -> FilePath -> ArtifactAssembly -> B9 [ArtifactTarget]
Documentation
buildArtifacts :: ArtifactGenerator -> B9 String Source #
Execute an ArtifactGenerator
and return a B9Invokation
that returns
the build id obtained by getBuildId
.
getArtifactOutputFiles :: ArtifactGenerator -> Either String [FilePath] Source #
Return a list of relative paths for the local files to be generated
by the ArtifactGenerator. This excludes Shared
and Transient image targets.
assemble :: ArtifactGenerator -> B9 [AssembledArtifact] Source #
Run an artifact generator to produce the artifacts.
evalArtifactGenerator :: String -> String -> BuildVariables -> ArtifactGenerator -> Either String [InstanceGenerator [SourceGenerator]] Source #
Evaluate an ArtifactGenerator
into a list of low-level build instructions
that can be built with createAssembledArtifacts
.
parseArtifactGenerator :: ArtifactGenerator -> CGParser () Source #
Parse an artifacto generator inside a CGParser
monad.
withArtifactSources :: [ArtifactSource] -> CGParser () -> CGParser () Source #
Execute a CGParser
action in an environment that contains a list of
ArtifactSource
s.
eachBindingSetT :: ArtifactGenerator -> [String] -> [[String]] -> CGParser [[(String, String)]] Source #
eachBindingSet :: ArtifactGenerator -> [(String, [String])] -> CGParser [[(String, String)]] Source #
writeInstanceGenerator :: InstanceId -> ArtifactAssembly -> CGParser () Source #
Monad for creating Instance generators.
CGParser | |
|
Instances
Monad CGParser Source # | |
Functor CGParser Source # | |
Applicative CGParser Source # | |
MonadReader CGEnv CGParser Source # | |
MonadError CGError CGParser Source # | |
Defined in B9.ArtifactGeneratorImpl throwError :: CGError -> CGParser a # catchError :: CGParser a -> (CGError -> CGParser a) -> CGParser a # | |
MonadWriter [InstanceGenerator CGEnv] CGParser Source # | |
Defined in B9.ArtifactGeneratorImpl writer :: (a, [InstanceGenerator CGEnv]) -> CGParser a # tell :: [InstanceGenerator CGEnv] -> CGParser () # listen :: CGParser a -> CGParser (a, [InstanceGenerator CGEnv]) # pass :: CGParser (a, [InstanceGenerator CGEnv] -> [InstanceGenerator CGEnv]) -> CGParser a # |
Instances
Eq CGEnv Source # | |
Read CGEnv Source # | |
Show CGEnv Source # | |
MonadReader CGEnv CGParser Source # | |
MonadWriter [InstanceGenerator CGEnv] CGParser Source # | |
Defined in B9.ArtifactGeneratorImpl writer :: (a, [InstanceGenerator CGEnv]) -> CGParser a # tell :: [InstanceGenerator CGEnv] -> CGParser () # listen :: CGParser a -> CGParser (a, [InstanceGenerator CGEnv]) # pass :: CGParser (a, [InstanceGenerator CGEnv] -> [InstanceGenerator CGEnv]) -> CGParser a # |
data InstanceGenerator e Source #
Instances
Instances
Eq CGError Source # | |
Data CGError Source # | |
Defined in B9.ArtifactGeneratorImpl gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CGError -> c CGError # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CGError # toConstr :: CGError -> Constr # dataTypeOf :: CGError -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c CGError) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CGError) # gmapT :: (forall b. Data b => b -> b) -> CGError -> CGError # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CGError -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CGError -> r # gmapQ :: (forall d. Data d => d -> u) -> CGError -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> CGError -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> CGError -> m CGError # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CGError -> m CGError # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CGError -> m CGError # | |
Read CGError Source # | |
Show CGError Source # | |
MonadError CGError CGParser Source # | |
Defined in B9.ArtifactGeneratorImpl throwError :: CGError -> CGParser a # catchError :: CGParser a -> (CGError -> CGParser a) -> CGParser a # |
execCGParser :: CGParser () -> CGEnv -> Either CGError [InstanceGenerator CGEnv] Source #
execIGEnv :: InstanceGenerator CGEnv -> Either String (InstanceGenerator [SourceGenerator]) Source #
substAssembly :: [(String, String)] -> ArtifactAssembly -> ArtifactAssembly Source #
toSourceGen :: [(String, String)] -> ArtifactSource -> Either String [SourceGenerator] Source #
createAssembledArtifacts :: [InstanceGenerator [SourceGenerator]] -> B9 [AssembledArtifact] Source #
generateSources :: FilePath -> InstanceGenerator [SourceGenerator] -> B9 (InstanceGenerator FilePath) Source #
generateSourceTo :: FilePath -> SourceGenerator -> B9 () Source #
sgReadSourceFile :: [(String, String)] -> SourceFile -> B9 ByteString Source #
data SourceGenerator Source #
Internal data type simplifying the rather complex source generation by
bioling down ArtifactSource
s to a flat list of uniform SourceGenerator
s.
Instances
Eq SourceGenerator Source # | |
Defined in B9.ArtifactGeneratorImpl (==) :: SourceGenerator -> SourceGenerator -> Bool # (/=) :: SourceGenerator -> SourceGenerator -> Bool # | |
Read SourceGenerator Source # | |
Defined in B9.ArtifactGeneratorImpl | |
Show SourceGenerator Source # | |
Defined in B9.ArtifactGeneratorImpl showsPrec :: Int -> SourceGenerator -> ShowS # show :: SourceGenerator -> String # showList :: [SourceGenerator] -> ShowS # |
sourceGeneratorOutputFile :: SourceGenerator -> FilePath Source #
Return the (internal-)output file of the source file that is generated.
Instances
Eq SGPerm Source # | |
Data SGPerm Source # | |
Defined in B9.ArtifactGeneratorImpl gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SGPerm -> c SGPerm # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SGPerm # toConstr :: SGPerm -> Constr # dataTypeOf :: SGPerm -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SGPerm) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SGPerm) # gmapT :: (forall b. Data b => b -> b) -> SGPerm -> SGPerm # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SGPerm -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SGPerm -> r # gmapQ :: (forall d. Data d => d -> u) -> SGPerm -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> SGPerm -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SGPerm -> m SGPerm # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SGPerm -> m SGPerm # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SGPerm -> m SGPerm # | |
Read SGPerm Source # | |
Show SGPerm Source # | |
sgGetFroms :: SourceGenerator -> [SourceFile] Source #
setSGPerm :: Int -> Int -> Int -> SourceGenerator -> Either String SourceGenerator Source #
createTarget :: InstanceId -> FilePath -> ArtifactAssembly -> B9 [ArtifactTarget] Source #
Create the actual target, either just a mountpoint, or an ISO or VFAT image.