hapistrano-0.3.4.0: 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 Source #

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

Minimal complete definition

renderCommand, parseResult

Associated Types

type Result a :: * Source #

Type of result.

Methods

renderCommand :: a -> String Source #

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

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

How to parse the result from stdout.

Instances

Command GenericCommand Source # 
Command GitReset Source # 
Command GitFetch Source # 
Command GitClone Source # 
Command GitCheckout Source # 
Command Touch Source # 
Command Ls Source # 

Associated Types

type Result Ls :: * Source #

Command Ln Source # 

Associated Types

type Result Ln :: * Source #

Command Rm Source # 

Associated Types

type Result Rm :: * Source #

Command MkDir Source # 
Command Whoami Source # 
Command (Find File) Source # 

Associated Types

type Result (Find File) :: * Source #

Command (Find Dir) Source # 

Associated Types

type Result (Find Dir) :: * Source #

Command (Readlink File) Source # 
Command (Readlink Dir) Source # 
Command (Mv File) Source # 

Associated Types

type Result (Mv File) :: * Source #

Command (Mv Dir) Source # 

Associated Types

type Result (Mv Dir) :: * Source #

Command cmd => Command (Cd cmd) Source # 

Associated Types

type Result (Cd cmd) :: * Source #

Methods

renderCommand :: Cd cmd -> String Source #

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

data Cd cmd Source #

Specify directory in which to perform another command.

Constructors

Cd (Path Abs Dir) cmd 

Instances

Command cmd => Command (Cd cmd) Source # 

Associated Types

type Result (Cd cmd) :: * Source #

Methods

renderCommand :: Cd cmd -> String Source #

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

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

data MkDir Source #

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

Constructors

MkDir (Path Abs Dir) 

Instances

data Rm where Source #

Delete file or directory.

Constructors

Rm :: Path Abs t -> Rm 

Instances

Command Rm Source # 

Associated Types

type Result Rm :: * Source #

type Result Rm Source # 
type Result Rm = ()

data Mv t Source #

Move or rename files or directories.

Constructors

Mv (Path Abs t) (Path Abs t) 

Instances

Command (Mv File) Source # 

Associated Types

type Result (Mv File) :: * Source #

Command (Mv Dir) Source # 

Associated Types

type Result (Mv Dir) :: * Source #

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

data Ln where Source #

Create symlinks.

Constructors

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

Instances

Command Ln Source # 

Associated Types

type Result Ln :: * Source #

type Result Ln Source # 
type Result Ln = ()

data Ls Source #

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 Source # 

Associated Types

type Result Ls :: * Source #

type Result Ls Source # 
type Result Ls = ()

data Find t Source #

Find (a very limited version).

Constructors

Find Natural (Path Abs Dir) 

Instances

data Touch Source #

touch.

Constructors

Touch (Path Abs File) 

Instances

data GitFetch Source #

Git fetch (simplified).

Constructors

GitFetch String 

data GitReset Source #

Git reset.

Constructors

GitReset String 

mkGenericCommand :: String -> Maybe GenericCommand Source #

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

unGenericCommand :: GenericCommand -> String Source #

Get the raw command back from GenericCommand.

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

Read commands from a file.