hapistrano-0.3.2.2: A deployment library for Haskell applications

Copyright© 2015-2017 Stack Builders
LicenseMIT
MaintainerJustin Leitgeb <justin@stackbuilders.com>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

System.Hapistrano.Commands

Description

Collection of type safe shell commands that can be fed into runCommand.

Synopsis

Documentation

class Command a where #

Class for data types that represent shell commands in typed way.

Minimal complete definition

renderCommand, parseResult

Associated Types

type Result a :: * #

Type of result.

Methods

renderCommand :: a -> String #

How to render the command before feeding it into shell (possibly via SSH).

parseResult :: Proxy a -> String -> Result a #

How to parse the result from stdout.

Instances

Command GenericCommand # 
Command GitReset # 

Associated Types

type Result GitReset :: * #

Command GitFetch # 

Associated Types

type Result GitFetch :: * #

Command GitClone # 

Associated Types

type Result GitClone :: * #

Command Touch # 

Associated Types

type Result Touch :: * #

Command Ls # 

Associated Types

type Result Ls :: * #

Command Ln # 

Associated Types

type Result Ln :: * #

Command Rm # 

Associated Types

type Result Rm :: * #

Command MkDir # 

Associated Types

type Result MkDir :: * #

Command Whoami # 

Associated Types

type Result Whoami :: * #

Command (Find File) # 

Associated Types

type Result (Find File) :: * #

Command (Find Dir) # 

Associated Types

type Result (Find Dir) :: * #

Command (Readlink File) # 
Command (Readlink Dir) # 

Associated Types

type Result (Readlink Dir) :: * #

Command (Mv File) # 

Associated Types

type Result (Mv File) :: * #

Command (Mv Dir) # 

Associated Types

type Result (Mv Dir) :: * #

Command cmd => Command (Cd cmd) # 

Associated Types

type Result (Cd cmd) :: * #

Methods

renderCommand :: Cd cmd -> String #

parseResult :: Proxy * (Cd cmd) -> String -> Result (Cd cmd) #

data Whoami #

Unix whoami.

Constructors

Whoami 

Instances

data Cd cmd #

Specify directory in which to perform another command.

Constructors

Cd (Path Abs Dir) cmd 

Instances

Command cmd => Command (Cd cmd) # 

Associated Types

type Result (Cd cmd) :: * #

Methods

renderCommand :: Cd cmd -> String #

parseResult :: Proxy * (Cd cmd) -> String -> Result (Cd cmd) #

type Result (Cd cmd) # 
type Result (Cd cmd) = Result cmd

data MkDir #

Create a directory. Does not fail if the directory already exists.

Constructors

MkDir (Path Abs Dir) 

Instances

Command MkDir # 

Associated Types

type Result MkDir :: * #

type Result MkDir # 
type Result MkDir = ()

data Rm where #

Delete file or directory.

Constructors

Rm :: Path Abs t -> Rm 

Instances

Command Rm # 

Associated Types

type Result Rm :: * #

type Result Rm # 
type Result Rm = ()

data Mv t #

Move or rename files or directories.

Constructors

Mv (Path Abs t) (Path Abs t) 

Instances

Command (Mv File) # 

Associated Types

type Result (Mv File) :: * #

Command (Mv Dir) # 

Associated Types

type Result (Mv Dir) :: * #

type Result (Mv File) # 
type Result (Mv File) = ()
type Result (Mv Dir) # 
type Result (Mv Dir) = ()

data Ln where #

Create symlinks.

Constructors

Ln :: Path Abs t -> Path Abs File -> Ln 

Instances

Command Ln # 

Associated Types

type Result Ln :: * #

type Result Ln # 
type Result Ln = ()

data Ls #

ls, so far used only to check existence of directories, so it's not very functional right now.

Constructors

Ls (Path Abs Dir) 

Instances

Command Ls # 

Associated Types

type Result Ls :: * #

type Result Ls # 
type Result Ls = ()

data Readlink t #

Read link.

Constructors

Readlink (Path Abs File) 

data Find t #

Find (a very limited version).

Constructors

Find Natural (Path Abs Dir) 

Instances

Command (Find File) # 

Associated Types

type Result (Find File) :: * #

Command (Find Dir) # 

Associated Types

type Result (Find Dir) :: * #

type Result (Find File) # 
type Result (Find Dir) # 
type Result (Find Dir) = [Path Abs Dir]

data Touch #

touch.

Constructors

Touch (Path Abs File) 

Instances

Command Touch # 

Associated Types

type Result Touch :: * #

type Result Touch # 
type Result Touch = ()

data GitClone #

Git clone.

Instances

data GitFetch #

Git fetch (simplified).

Constructors

GitFetch String 

Instances

data GitReset #

Git reset.

Constructors

GitReset String 

Instances

mkGenericCommand :: String -> Maybe GenericCommand #

Smart constructor that allows to create GenericCommands. Just a little bit more safety.

unGenericCommand :: GenericCommand -> String #

Get the raw command back from GenericCommand.

readScript :: MonadIO m => Path Abs File -> m [GenericCommand] #

Read commands from a file.