Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Provide high-level functions to build Haskell-project using some docker image
- data BuildArgs
- asBinaryName :: BuildArgs -> String
- asStackArg :: BuildArgs -> [String]
- stackInDocker :: ImageName -> FilePath -> BuildArgs -> IO FilePath
Documentation
Arguments passed to stack
when building desired target
SimpleTarget String | A simply named target for stack, assumes component is unique in all current packages. See https://docs.haskellstack.org/en/stable/build_command/#target-syntax. |
FullTarget String String | A fully named target for stack to build. Assumes component is an executable type. |
GHCOption String | Pass arguments to GHC |
MoreArgs BuildArgs BuildArgs | Compose arguments |
NoArgs | Neutral element for |
asBinaryName :: BuildArgs -> String Source #
asStackArg :: BuildArgs -> [String] Source #
stackInDocker :: ImageName -> FilePath -> BuildArgs -> IO FilePath Source #
Build a Haskell project using some docker image.
In order to maximize reuse, this process creates in the current directory a file called `.cidfile` which contains the id of the latest container that ran the build. When this file exists, the next run will reuse the volumes of the previous run which means built dependencies will normally be available.
The built target, which is assumed to be a binary executable, is then extracted from the container and copied
locally in a file named after asBinaryName
.
TODO: run with current user in the container or reuse stack's docker capabilities