hapistrano-0.4.3.0: A deployment library for Haskell applications
Copyright© 2015-Present Stack Builders
LicenseMIT
MaintainerJuan Paucar <jpaucar@stackbuilders.com>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

System.Hapistrano.Commands.Internal

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.

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

Instances details
Command GenericCommand Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result GenericCommand Source #

Command GitReset Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result GitReset Source #

Command GitFetch Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result GitFetch Source #

Command GitClone Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result GitClone Source #

Command GitCheckout Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result GitCheckout Source #

Command Touch Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result Touch Source #

Command Ls Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result Ls Source #

Command Ln Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result Ln Source #

Command Rm Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result Rm Source #

Command MkDir Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result MkDir Source #

Command Whoami Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result Whoami Source #

Command (Find File) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Find File) Source #

Command (Find Dir) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Find Dir) Source #

Command (Readlink File) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Readlink File) Source #

Command (Readlink Dir) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Readlink Dir) Source #

Command (Mv File) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Mv File) Source #

Command (Mv Dir) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Mv Dir) Source #

Command cmd => Command (Cd cmd) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Cd cmd) Source #

Methods

renderCommand :: Cd cmd -> String Source #

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

data Whoami Source #

Unix whoami.

Constructors

Whoami 

Instances

Instances details
Eq Whoami Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Methods

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

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

Ord Whoami Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Show Whoami Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Command Whoami Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result Whoami Source #

type Result Whoami Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

data Cd cmd Source #

Specify directory in which to perform another command.

Constructors

Cd (Path Abs Dir) cmd 

Instances

Instances details
Command cmd => Command (Cd cmd) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

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 # 
Instance details

Defined in System.Hapistrano.Commands.Internal

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

Instances details
Command MkDir Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result MkDir Source #

type Result MkDir Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

type Result MkDir = ()

data Rm where Source #

Delete file or directory.

Constructors

Rm :: Path Abs t -> Rm 

Instances

Instances details
Command Rm Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result Rm Source #

type Result Rm Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

type Result Rm = ()

data Mv t Source #

Move or rename files or directories.

Constructors

Mv TargetSystem (Path Abs t) (Path Abs t) 

Instances

Instances details
Command (Mv File) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Mv File) Source #

Command (Mv Dir) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Mv Dir) Source #

type Result (Mv File) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

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

Defined in System.Hapistrano.Commands.Internal

type Result (Mv Dir) = ()

data Ln where Source #

Create symlinks.

Constructors

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

Instances

Instances details
Command Ln Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result Ln Source #

type Result Ln Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

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

Instances details
Command Ls Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result Ls Source #

type Result Ls Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

type Result Ls = ()

data Find t Source #

Find (a very limited version).

Constructors

Find Natural (Path Abs Dir) 

Instances

Instances details
Command (Find File) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Find File) Source #

Command (Find Dir) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Find Dir) Source #

type Result (Find File) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

type Result (Find Dir) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

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

data Touch Source #

touch.

Constructors

Touch (Path Abs File) 

Instances

Instances details
Command Touch Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result Touch Source #

type Result Touch Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

type Result Touch = ()

data GitCheckout Source #

Git checkout.

Constructors

GitCheckout String 

data GitClone Source #

Git clone.

Instances

Instances details
Command GitClone Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result GitClone Source #

type Result GitClone Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

type Result GitClone = ()

data GitFetch Source #

Git fetch (simplified).

Constructors

GitFetch String 

Instances

Instances details
Command GitFetch Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result GitFetch Source #

type Result GitFetch Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

type Result GitFetch = ()

data GitReset Source #

Git reset.

Constructors

GitReset String 

Instances

Instances details
Command GitReset Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result GitReset Source #

type Result GitReset Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

type Result GitReset = ()

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.

formatCmd :: String -> [Maybe String] -> String Source #

Format a command.

quoteCmd :: String -> String Source #

Simple-minded quoter.

trim :: String -> String Source #

Trim whitespace from beginning and end.

isLinux :: TargetSystem -> Bool Source #

Determines whether or not the target system is a Linux machine.