Safe Haskell | None |
---|
A continuous integration system. For an example of how to get started see https://github.com/ndmitchell/bake#readme.
- bake :: Oven state patch test -> IO ()
- data Oven state patch test = Oven {
- ovenUpdateState :: Maybe (state, [patch]) -> IO state
- ovenPrepare :: state -> [patch] -> IO [test]
- ovenTestInfo :: test -> TestInfo test
- ovenNotify :: [Author] -> String -> IO ()
- ovenPatchExtra :: state -> Maybe patch -> IO (String, String)
- ovenServer :: (Host, Port)
- ovenStringyState :: Stringy state
- ovenStringyPatch :: Stringy patch
- ovenStringyTest :: Stringy test
- defaultOven :: Oven () () ()
- data Stringy s = Stringy {
- stringyTo :: s -> String
- stringyFrom :: String -> s
- stringyPretty :: s -> String
- readShowStringy :: (Show s, Read s) => Stringy s
- ovenTest :: Stringy test -> IO [test] -> (test -> TestInfo test) -> Oven state patch () -> Oven state patch test
- ovenGit :: String -> String -> Maybe FilePath -> Oven () () test -> Oven SHA1 SHA1 test
- ovenNotifyStdout :: Oven state patch test -> Oven state patch test
- ovenNotifyEmail :: (Host, Port) -> Oven state patch test -> Oven state patch test
- ovenPretty :: Show patch => String -> Oven state patch test -> Oven state (Pretty patch) test
- ovenIncremental :: Oven state patch test -> Oven state patch test
- incrementalDone :: IO ()
- data TestInfo test
- run :: IO () -> TestInfo test
- threads :: Int -> TestInfo test -> TestInfo test
- threadsAll :: TestInfo test -> TestInfo test
- require :: [test] -> TestInfo test -> TestInfo test
- suitable :: IO Bool -> TestInfo test -> TestInfo test
- startServer :: Port -> FilePath -> Author -> String -> Double -> Oven state patch test -> IO ()
- startClient :: (Host, Port) -> Author -> String -> Int -> Double -> Oven state patch test -> IO ()
- sendPause :: (Host, Port) -> Author -> IO ()
- sendUnpause :: (Host, Port) -> Author -> IO ()
- sendAddPatch :: (Host, Port) -> Author -> String -> IO ()
- sendDelPatch :: (Host, Port) -> Author -> String -> IO ()
- sendDelAllPatches :: (Host, Port) -> Author -> IO ()
- type Host = String
- type Port = Int
- type Author = String
Execute
bake :: Oven state patch test -> IO ()Source
The entry point to the system. Usually you will define:
main = bake myOven
Where myOven
defines details about the server. The program
deals with command line arguments, run --help
for details.
Central types
data Oven state patch test Source
The central type defining a continuous integration system.
Usually constructed with defaultOven
then filled out with other
Oven
modifiers such as ovenGit
and ovenTest
.
The types are: state
is the base state of the system (think HEAD on the master branch);
patch
is a change that is proposed (think a diff); test
is the type of tests that
are run.
All IO operations will be called in a direct subdirectory of the directory you start
bake
from. In particular:
ovenUpdateState
will always be called single-threaded from bake-server
;
ovenPatchExtra
will always be called from bake-patch-hash
;
ovenPrepare
and run
will always be called from bake-test-hash
.
Oven | |
|
defaultOven :: Oven () () ()Source
The default oven, which doesn't do anything interesting. Usually the starting point.
A type representing a translation between a value and a string, which can be
produced by readShowStringy
if the type has both Read
and Show
instances.
The functions stringyTo
and stringyFrom
should be inverses of each other.
The function stringyPretty
shows a value in a way suitable for humans, and can
discard uninteresting information.
Stringy | |
|
readShowStringy :: (Show s, Read s) => Stringy sSource
Oven modifiers
ovenTest :: Stringy test -> IO [test] -> (test -> TestInfo test) -> Oven state patch () -> Oven state patch testSource
ovenGit :: String -> String -> Maybe FilePath -> Oven () () test -> Oven SHA1 SHA1 testSource
Modify an Oven
to work with the Git version control system.
Requires the name of the repo (e.g. https://github.com/ndmitchell/bake.git
)
and the name of a branch (e.g. master
). You can optionally give a path fragment
which is used to clone into.
ovenNotifyStdout :: Oven state patch test -> Oven state patch testSource
Produce notifications on stdout
when users should be notified about success/failure.
ovenNotifyEmail :: (Host, Port) -> Oven state patch test -> Oven state patch testSource
Email notifications when users should be notified about success/failure. Requires the host/port of an SMTP server. Not yet implemented, will always crash.
ovenIncremental :: Oven state patch test -> Oven state patch testSource
This requires a version of cp
. On Windows, you can get that here:
http://gnuwin32.sourceforge.net/packages/coreutils.htm
incrementalDone :: IO ()Source
TestInfo members
threads :: Int -> TestInfo test -> TestInfo testSource
Change the number of threads a test requires, defaults to 1.
threadsAll :: TestInfo test -> TestInfo testSource
Record that a test requires all available threads on a machine,
typically used for the build step.
Use getNumCapabilities
to find out how many threads you were allocated.
require :: [test] -> TestInfo test -> TestInfo testSource
Require the following tests have been evaluated on this machine before this test is run. Typically used to require compilation before running most tests.
suitable :: IO Bool -> TestInfo test -> TestInfo testSource
Is a particular client capable of running a test. Usually an OS check.
Operations
startServer :: Port -> FilePath -> Author -> String -> Double -> Oven state patch test -> IO ()Source
startClient :: (Host, Port) -> Author -> String -> Int -> Double -> Oven state patch test -> IO ()Source