Copyright | (c) Ingolf Wagner 2017 |
---|---|
License | GPL-3 |
Maintainer | azubi@ingolf-wagner.de |
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe |
Language | Haskell2010 |
Example:
import Azubi
main :: IO ()
main = azubiMain $ []
& installed (Ebuild "vim")
& uptodate (Git "gitgithub.com:mrVanDalo/azubi.git" "/dev/shm/azubi")
& installed (Git "git
github.com:mrVanDalo/azubi-config.git" "/dev/shm/azubi-config")
& run (Always "touch" ["devshm/run.test"])
& link "/dev/shm/azubi.link" "/dev/shm/azubi"
- data State
- data Ebuild = Ebuild String
- data Git = Git RepoUrl Path
- data RunCommand
- installed :: Installable a => a -> State
- class Installable a where
- uptodate :: Updatable a => a -> State
- class Updatable a where
- run :: RunCommand -> State
- link :: Path -> Path -> State
- folderExists :: Path -> State
- content :: Path -> [String] -> State
- requires :: State -> State -> State
- submodule :: [State] -> State
- (&) :: [State] -> State -> [State]
- azubiMain :: [State] -> IO ()
Documentation
The low level element to formulate a state on a machine.
If the check returns No
the Command
s will run.
So the author should make sure the Command
will result
in a Yes
the next time this state will run.
All Check
s have to return Yes
to avoid the Command
s
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 State
s will not be run.
Git RepoUrl Path |
data RunCommand Source #
The way a command should be run. See run
installed :: Installable a => a -> State Source #
install a piece of software on the system. The piece of software should be typed of course.
class Installable a where Source #
To install Software you have to instance the Installable class.
class Updatable a where Source #
Same like Installable
but will also
make sure there you have the newest
version.
link :: Path -> Path -> State Source #
ensure there is a link file -> target
example:
link "~/file" "~/target"
will create a link at ~/file/
pointing to ~/target/
folderExists :: Path -> State Source #
make sure a folder exists
content :: Path -> [String] -> State Source #
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.
submodule :: [State] -> State Source #
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.