-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Continuous integration system -- @package bake @version 0.3 -- | A continuous integration system. For an example of how to get started -- see https://github.com/ndmitchell/bake#readme. module Development.Bake -- | 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. bake :: (Stringy state, Stringy patch, Stringy test) => Oven state patch test -> IO () -- | 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: ovenInit -- will always be called single-threaded from bake-init; -- ovenUpdate will always be called single-threaded from -- bake-update-hash; ovenPatchExtra will always be -- called from bake-extra-hash; ovenPrepare and -- run will always be called from bake-test-hash. data Oven state patch test Oven :: IO state -> (state -> [patch] -> IO state) -> (state -> [patch] -> IO [test]) -> (test -> TestInfo test) -> ([Author] -> String -> IO ()) -> (state -> Maybe patch -> IO (String, String)) -> (Host, Port) -> (patch -> patch -> Bool) -> Oven state patch test -- | Get an initial state ovenInit :: Oven state patch test -> IO state -- | Given a state, and a set of candiates that have passed, merge to -- create a new state ovenUpdate :: Oven state patch test -> state -> [patch] -> IO state -- | Prepare a candidate to be run, produces the tests that must pass ovenPrepare :: Oven state patch test -> state -> [patch] -> IO [test] -- | Produce information about a test ovenTestInfo :: Oven state patch test -> test -> TestInfo test -- | Tell an author some information contained in the string (usually an -- email) ovenNotify :: Oven state patch test -> [Author] -> String -> IO () -- | Extra information about a patch, a single line (HTML span), and a -- longer chunk (HTML block) ovenPatchExtra :: Oven state patch test -> state -> Maybe patch -> IO (String, String) -- | Default server to use ovenServer :: Oven state patch test -> (Host, Port) -- | Given two patches (first on submitted first) is the first now -- redundant ovenSupersede :: Oven state patch test -> patch -> patch -> Bool -- | The default oven, which doesn't do anything interesting. Usually the -- starting point. defaultOven :: Oven () () () -- | 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. class Stringy s where stringyPretty = stringyTo stringyTo :: Stringy s => s -> String stringyFrom :: Stringy s => String -> s stringyPretty :: Stringy s => s -> String -- | Given a Stringy for test, and a function that when run -- on a code base returns the list of tests that need running, and a -- function to populate a TestInfo, modify the Oven with a -- test type. ovenTest :: IO [test] -> (test -> TestInfo test) -> Oven state patch () -> Oven state patch test data SHA1 -- | 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. ovenGit :: String -> String -> Maybe FilePath -> Oven () () test -> Oven SHA1 SHA1 test -- | Oven creation for modules using git with the step strategy. ovenStepGit :: IO [FilePath] -> String -> String -> Maybe FilePath -> Oven () () test -> Oven SHA1 SHA1 test -- | Add an additional notification to the list. ovenNotifyAdd :: ([Author] -> String -> IO ()) -> Oven state patch test -> Oven state patch test -- | Produce notifications on stdout when users should be notified -- about success/failure. ovenNotifyStdout :: Oven state patch test -> Oven state patch test -- | Email notifications when users should be notified about -- success/failure. ovenNotifyEmail :: (Host, Port) -> (Author -> [String]) -> Oven state patch test -> Oven state patch test ovenPretty :: Oven state patch test -> Oven state (Pretty patch) test ovenPrettyMerge :: Oven state (Pretty patch) test -> Oven state (Pretty patch) test -- | Information about a test. data TestInfo test -- | The action associated with a test. run :: IO () -> TestInfo test -- | Change the number of threads a test requires, defaults to 1. threads :: Int -> TestInfo test -> TestInfo test -- | 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. threadsAll :: TestInfo test -> TestInfo test -- | Require the following tests have been evaluated on this machine before -- this test is run. Typically used to require compilation before running -- most tests. depend :: [test] -> TestInfo test -> TestInfo test -- | Is a particular client capable of running a test. Usually an OS check. -- To run a test must have all its requirements met. Clients can satisfy -- a requirement by passing --provide=... on the command line. require :: [String] -> TestInfo test -> TestInfo test -- | Set the priority of a test, those with higher priority are run first. -- Tests have a default priority of 0. priority :: Int -> TestInfo test -> TestInfo test startServer :: (Stringy state, Stringy patch, Stringy test) => Port -> [Author] -> Seconds -> String -> Bool -> Oven state patch test -> IO () startClient :: (Stringy state, Stringy patch, Stringy test) => (Host, Port) -> Author -> String -> Int -> [String] -> Double -> Oven state patch test -> IO () -- | Garbage collect enough files to satisfy the requirements. garbageCollect :: Integer -> Double -> Seconds -> [FilePath] -> 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 () sendRequeue :: (Host, Port) -> Author -> IO () sendAddSkip :: (Host, Port) -> Author -> String -> IO () sendDelSkip :: (Host, Port) -> Author -> String -> IO () sendSetState :: (Host, Port) -> Author -> String -> IO () type Host = String type Port = Int type Author = String