hapistrano-0.4.0.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
Command GenericCommand Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result GenericCommand :: Type Source #

Command GitReset Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result GitReset :: Type Source #

Command GitFetch Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result GitFetch :: Type Source #

Command GitClone Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result GitClone :: Type Source #

Command GitCheckout Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result GitCheckout :: Type Source #

Command Touch Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result Touch :: Type Source #

Command Ls Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result Ls :: Type Source #

Command Ln Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result Ln :: Type Source #

Command Rm Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result Rm :: Type Source #

Command MkDir Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result MkDir :: Type Source #

Command Whoami Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result Whoami :: Type Source #

Command (Find File) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Find File) :: Type Source #

Command (Find Dir) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Find Dir) :: Type Source #

Command (Readlink File) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Readlink File) :: Type Source #

Command (Readlink Dir) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Readlink Dir) :: Type Source #

Command (Mv File) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Mv File) :: Type Source #

Command (Mv Dir) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Mv Dir) :: Type Source #

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

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Cd cmd) :: Type Source #

Methods

renderCommand :: Cd cmd -> String Source #

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

data Whoami Source #

Unix whoami.

Constructors

Whoami 
Instances
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 :: Type 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
Command cmd => Command (Cd cmd) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Cd cmd) :: Type 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
Command MkDir Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result MkDir :: Type 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
Command Rm Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result Rm :: Type 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
Command (Mv File) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Mv File) :: Type Source #

Command (Mv Dir) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Mv Dir) :: Type 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
Command Ln Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result Ln :: Type 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
Command Ls Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result Ls :: Type 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
Command (Find File) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Find File) :: Type Source #

Command (Find Dir) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Find Dir) :: Type 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
Command Touch Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result Touch :: Type Source #

type Result Touch Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

type Result Touch = ()

data GitClone Source #

Git clone.

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.

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.