| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
B9.Artifact.Readable
Contents
Description
Top-Level data types for B9 build artifacts.
Synopsis
- data ArtifactGenerator
- = Sources [ArtifactSource] [ArtifactGenerator]
- | Let [(String, String)] [ArtifactGenerator]
- | LetX [(String, [String])] [ArtifactGenerator]
- | Each [(String, [String])] [ArtifactGenerator]
- | EachT [String] [[String]] [ArtifactGenerator]
- | Artifact InstanceId ArtifactAssembly
- | EmptyArtifact
- newtype InstanceId = IID String
- data ArtifactTarget
- data CloudInitType
- data ArtifactAssembly
- data AssembledArtifact = AssembledArtifact InstanceId [ArtifactTarget]
- data AssemblyOutput
- instanceIdKey :: String
- buildIdKey :: String
- buildDateKey :: String
- getAssemblyOutput :: ArtifactAssembly -> [AssemblyOutput]
- data ArtifactSource
- getArtifactSourceFiles :: ArtifactSource -> [FilePath]
Documentation
data ArtifactGenerator Source #
Artifacts represent the things B9 can build. A generator specifies howto generate parameterized, multiple artifacts. The general structure is:
Let [ ... bindings ... ]
[ Sources
[ ... list all input files ... ]
[ Artifact ...
, Artifact ...
, Let [ ... ] [ ... ]
]
]
The reasons why Sources takes a list of ArtifactGenerators is that
- this makes the value easier to read/write for humans
- the sources are static files used in all children (e.g. company logo image)
- the sources are parameterized by variables that bound to different values for each artifact, e.g. a template network config file which contains the host IP address.
To bind such variables use Let, Each, LetX or EachT.
String substitution of these variables is done by B9.Artifact.Content.StringTemplate.
These variables can be used as value in nested Lets, in most file names/paths
and in source files added with SourceFile
- - @deprecated TODO remove this when switching to Dhall
Constructors
| Sources [ArtifactSource] [ArtifactGenerator] | Add sources available to |
| Let [(String, String)] [ArtifactGenerator] | Bind variables, variables are available in nested generators. @deprecated TODO remove this when switching to Dhall |
| LetX [(String, [String])] [ArtifactGenerator] | A LetX [("x", ["1","2","3"]), ("y", ["a","b"])] [..]
Is equal to: Let [] [
Let [("x", "1"), ("y", "a")] [..]
Let [("x", "1"), ("y", "b")] [..]
Let [("x", "2"), ("y", "a")] [..]
Let [("x", "2"), ("y", "b")] [..]
Let [("x", "3"), ("y", "a")] [..]
Let [("x", "3"), ("y", "b")] [..]
]
@deprecated TODO remove this when switching to Dhall |
| Each [(String, [String])] [ArtifactGenerator] | Bind each variable to their first value, then each
variable to the second value, etc ... and execute the
nested generator in every step. |
| EachT [String] [[String]] [ArtifactGenerator] | The transposed version of |
| Artifact InstanceId ArtifactAssembly | Generate an artifact defined by an
|
| EmptyArtifact |
Instances
newtype InstanceId Source #
Identify an artifact. Deprecated TODO: B9 does not check if all instances IDs are unique.
Instances
data ArtifactTarget Source #
Constructors
| CloudInitTarget CloudInitType FilePath | |
| VmImagesTarget |
Instances
data CloudInitType Source #
Instances
data ArtifactAssembly Source #
Define an output of a build. Assemblies are nested into
ArtifactGenerators. They contain all the files defined by the Sources
they are nested into.
Constructors
| CloudInit [CloudInitType] FilePath | Generate a cloud-init compatible directory, ISO-
or VFAT image, as specified by the list of
|
| VmImages [ImageTarget] VmScript | a set of VM-images that were created by executing a build script on them. |
Instances
data AssembledArtifact Source #
A symbolic representation of the targets assembled by
assemble from an ArtifactAssembly. There is a
list of ArtifactTargets because e.g. a single CloudInit can produce up to
three output files, a directory, an ISO image and a VFAT image.
Constructors
| AssembledArtifact InstanceId [ArtifactTarget] |
Instances
data AssemblyOutput Source #
The output of an ArtifactAssembly is either a set of generated files,
or it might be a directory that contains the artifacts sources.
Instances
instanceIdKey :: String Source #
The variable containing the instance id. Deprecated
buildIdKey :: String Source #
The variable containing the buildId that identifies each execution of
B9. For more info about variable substitution in source files see
StringTemplate
buildDateKey :: String Source #
The variable containing the date and time a build was started. For more
info about variable substitution in source files see
StringTemplate
getAssemblyOutput :: ArtifactAssembly -> [AssemblyOutput] Source #
Return the files that the artifact assembly consist of.
Re-exports
data ArtifactSource Source #
Describe how input files for artifacts to build are obtained. The general structure of each constructor is FromXXX destination source
Constructors
| FromFile FilePath SourceFile | Copy a |
| FromContent FilePath Content | Create a file from some |
| SetPermissions Int Int Int [ArtifactSource] | Set the unix file permissions to all files generated
by the nested list of |
| FromDirectory FilePath [ArtifactSource] | Assume a local directory as starting point for all
relative source files in the nested |
| IntoDirectory FilePath [ArtifactSource] | Specify an output directory for all the files
generated by the nested |
Instances
getArtifactSourceFiles :: ArtifactSource -> [FilePath] Source #
Return all source files generated by an ArtifactSource.