azubi-0.2.0.0: A simple DevOps tool which will never "reach" enterprice level.

Copyright(c) Ingolf Wagner 2017
LicenseGPL-3
Maintainerazubi@ingolf-wagner.de
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe
LanguageHaskell2010

Azubi

Description

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"

Synopsis

Documentation

data State Source #

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.

Constructors

State [Check] [Command] (Maybe Comment)

State contains checks and commands if one command failed the following commands will not be executed.

States [Check] [State] (Maybe Comment)

To create depended states which should stop being executed when a previous state fails

Instances

Eq State Source # 

Methods

(==) :: State -> State -> Bool #

(/=) :: State -> State -> Bool #

Show State Source # 

Methods

showsPrec :: Int -> State -> ShowS #

show :: State -> String #

showList :: [State] -> ShowS #

data Ebuild Source #

Ebuild is a Portage package (used by Gentoo and Funtoo).

http://gentoo.org

See installed.

Constructors

Ebuild String 

data Git Source #

Git is a version control system.

http://git.scm.com

See installed.

Constructors

Git RepoUrl Path 

data RunCommand Source #

The way a command should be run. See run

Constructors

Always String [Argument]

run command every time

Once String [Argument] Path

run command and creates a file to prevent to run again

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.

Minimal complete definition

installed

Methods

installed :: a -> State Source #

install a piece of software on the system. The piece of software should be typed of course.

uptodate :: Updatable a => a -> State Source #

make sure something is installed and up to date.

class Updatable a where Source #

Same like Installable but will also make sure there you have the newest version.

Minimal complete definition

uptodate

Methods

uptodate :: a -> State Source #

make sure something is installed and up to date.

run :: RunCommand -> State Source #

creates a State that will run a command of your choice.

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.

requires :: State -> State -> State Source #

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]

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.

(&) :: [State] -> State -> [State] Source #

State combinator.

[]
& folderExists "/tmp/foo"
& folderExists "/tmp/bar"

azubiMain :: [State] -> IO () Source #

The function you should use to get you commands running.