-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A simple DevOps tool which will never "reach" enterprice level. -- -- A simple DevOps tool which will never "reach" enterprice level. It is -- basically a Haskell lib which you can use to create nice scripts that -- setup you computer, via ssh bashscrip, Dockerfile, etc @package azubi @version 0.2.0.2 -- | Example: -- --
--   import Azubi
--   
--   main :: IO ()
--   main = azubiMain $ []
--          & installed (Ebuild "vim")
--          & uptodate (Git "gitgithub.com:mrVanDalo/azubi.git" "/dev/shm/azubi")
--          & installed (Git "gitgithub.com:mrVanDalo/azubi-config.git" "/dev/shm/azubi-config")
--          & run (Always "touch" ["devshm/run.test"])
--          & link "/dev/shm/azubi.link" "/dev/shm/azubi"
--   
module Azubi -- | The low level element to formulate a state on a machine. If the check -- returns No the Commands will run. So the author should -- make sure the Command will result in a Yes the next time -- this state will run. -- -- All Checks have to return Yes to avoid the -- Commands to be run. -- -- If a Command returns a Failure the following commands -- will not be called. Same holdes for States if one of the states -- fail, the following States will not be run. data State -- | State contains checks and commands if one command failed the following -- commands will not be executed. State :: [Check] -> [Command] -> (Maybe Comment) -> State -- | To create depended states which should stop being executed when a -- previous state fails States :: [Check] -> [State] -> (Maybe Comment) -> State -- | Ebuild is a Portage package (used by Gentoo and Funtoo). -- -- http://gentoo.org -- -- See installed. data Ebuild Ebuild :: String -> Ebuild -- | Git is a version control system. -- -- http://git.scm.com -- -- See installed. data Git Git :: RepoUrl -> Path -> [GitOption] -> Git data GitOption Recursive :: GitOption -- | The way a command should be run. See run data RunCommand -- | run command every time Always :: String -> [Argument] -> RunCommand -- | run command and creates a file to prevent to run again Once :: String -> [Argument] -> Path -> RunCommand -- | install a piece of software on the system. The piece of -- software should be typed of course. installed :: Installable a => a -> State -- | To install Software you have to instance the Installable class. class Installable a -- | install a piece of software on the system. The piece of -- software should be typed of course. installed :: Installable a => a -> State -- | make sure something is installed and up to date. uptodate :: Updatable a => a -> State -- | Same like Installable but will also make sure there you have -- the newest version. class Updatable a -- | make sure something is installed and up to date. uptodate :: Updatable a => a -> State -- | creates a State that will run a command of your choice. run :: RunCommand -> State -- | ensure there is a link file -> target -- -- example: -- --
--   link "~/file" "~/target"
--   
-- -- will create a link at ~/file/ pointing to ~/target/ link :: Path -> Path -> State -- | make sure a folder exists folderExists :: Path -> State -- | Create a state that ensures that a file in Path will have the -- content of the String List. -- -- Every String in the List will be a Line in the File. content :: Path -> [String] -> State -- | Creates a state out of two states. When the first State fails the -- second State will not be checked nor enforced. -- -- This can also be achieved using submodule: -- --
--   stateA requires stateB == submodule [stateB, stateA]
--   
requires :: State -> State -> State -- | Create a state containing of sub-states, which have to be fulfilled in -- order. -- -- If one state is not fulfilled, the following will be ignored. submodule :: [State] -> State -- | State combinator. -- --
--   []
--   & folderExists "/tmp/foo"
--   & folderExists "/tmp/bar"
--   
(&) :: [State] -> State -> [State] -- | The function you should use to get you commands running. azubiMain :: [State] -> IO () -- | A command is something that will be run. In a normal case you put a -- Check before using a State -- -- When a Command get executed, it will create a CommandResult. -- --
--   command -> exit code -> CommandResult
--   
data Command Run :: String -> [Argument] -> (Maybe Comment) -> Command FileContent :: Path -> [String] -> Command CreateSymlink :: Path -> Target -> Command CreateFolder :: Path -> Command Remove :: Path -> Command -- | Gather information about a situation. -- --
--   check -> success/failure
--   check -> exit code -> success/failure
--   
data Check -- | Check if command returns exit status -- --
--   0 -> Yes
--   _ -> No
--   
Check :: String -> [Argument] -> (Maybe Comment) -> Check AlwaysYes :: Check -- | Opposite result of a Check Not :: Check -> Check -- | Check if Path has content HasFileContent :: Path -> [String] -> Check -- | Check if a Symbolic link exists to a specific target SymlinkExists :: Path -> Target -> Check -- | Check if a folder exists FolderExists :: Path -> Check -- | Check if something exists at path DoesExist :: Path -> Check