开源软件名称:ndmitchell/bake开源软件地址:https://github.com/ndmitchell/bake开源编程语言:Haskell 99.1%开源软件介绍:WARNING: UNMAINTAINED PROJECTThis project is not actively developed - you are likely to be better of using something more complete (if you do want to use it, consider forking it and taking it over). See the blog post giving notes on why it is now unmaintained. Bake is a continuous integration server, designed for large, productive, semi-trusted teams. In particular it primarily targets:
To give a flavour, the web GUI looks of a running Bake system looks like: Acknowledgements: The name "Bake" is thanks to Andy Adams-Moran. The DesignBake is a Haskell library that can be used to put together a continuous integration server. To run Bake you start a single server for your project, which coordinates tasks, provides an HTTP API for submitting new patches, and a web-based GUI for viewing the progress of your patches. You also run some Bake clients which run the tests on behalf of the server. While Bake is written in Haskell, most of the tests are expected to just call some system command. There are a few aspects that make Bake different from most alternatives:
The WorkflowBake is highly parametrisable, and can be reconfigured to support several different styles of use, but here I give one plausible workflow. Imagine a number of developers, somewhere between 5 and 50. Each developer has 1 or 2 active branches they are working on. You have a master branch, which developers merge from once a day. When a developer has completed something they push their branch to the Git repo and register the SHA1 with Bake. Bake then tests the patch on all tests (in conjunction with all other patches that got promoted) and if it passes merges it into the master branch. Once a day (say 7pm) you pause the incoming patches, ensure the queue has emptied, then resume. An ExampleThe test suite provides both an example configuration and commands to drive it. Here we annotate a slightly simplified version of the example, for lists of imports see the original code. First we define an enumeration for where we want tests to run. Our server is going to require tests on both Windows and Linux before a data Platform = Linux | Windows deriving (Show,Read)
platforms = [Linux,Windows] Next we define the data Action = Compile | Run Int deriving (Show,Read) Our type is named allTests = [(p,t) | p <- platforms, t <- Compile : map Run [1,10,0]]
execute :: (Platform,Action) -> TestInfo (Platform,Action)
execute (p,Compile) = matchOS p $ run $ do
cmd "ghc --make Main.hs"
execute (p,Run i) = require [(p,Compile)] $ matchOS p $ run $ do
cmd ("." </> "Main") (show i) We have to declare #if WINDOWS
myPlatform = Windows
#else
myPlatform = Linux
#endif
matchOS :: Platform -> TestInfo t -> TestInfo t
matchOS p = suitable (return . (==) myPlatform) We use the main :: IO ()
main = bake $
ovenGit "http://example.com/myrepo.git" "master" $
ovenTest readShowStringy (return allTests) execute
defaultOven{ovenServer=("127.0.0.1",5000)} We define Using the ExampleNow we have defined the example, we need to start up some servers and clients using the command line for our tool. Assuming we compiled as To add a patch we can run When viewing the server, there are a few additional URL's that may be of use:
More ExamplesYou can find more examples at: |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论