--src/Core.hs data Pipeline = Pipeline { steps :: [Step] } deriving (Eq, Show) data Step = Step { name :: StepName , commands :: [String] , image :: Image } deriving (Eq, Show) data Build = Build { pipeline :: Pipeline , state :: BuildState } deriving (Eq, Show) data BuildState = BuildReady | BuildRunning | BuildFinished BuildResult deriving (Eq, Show) data BuildResult = BuildSucceeded | BuildFailed deriving (Eq, Show) newtype StepName = StepName String deriving (Eq, Show) newtype Image = Image String deriving (Eq, Show) -- test/Spec.hs -- Helper functions makeStep :: String -> String -> [String] -> Step makeStep name image commands = Step { name = StepName name , image = Image image , commands = commands } makePipeline :: [Step] -> Pipeline makePipeline steps = Pipeline { steps = steps } -- Test values testPipeline :: Pipeline testPipeline = makePipeline [ makeStep "First step" "ubuntu" ["date"] , makeStep "Second step" "ubuntu" ["uname -r"] ] testBuild :: Build testBuild = Build { pipeline = testPipeline , state = BuildReady } main :: IO () main = do putStrLn (show testBuild)