hapistrano-0.4.8.0: A deployment library for Haskell applications
Copyright© 2015-Present Stack Builders
LicenseMIT
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
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.

Associated Types

type Result a :: Type 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 BasicWrite Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result BasicWrite Source #

Command Cat Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result Cat Source #

Command CheckExists Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result CheckExists Source #

Command GenericCommand Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result GenericCommand Source #

Command GitCheckout Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result GitCheckout Source #

Command GitClone Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result GitClone Source #

Command GitFetch Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result GitFetch Source #

Command GitReset Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result GitReset Source #

Command GitSetOrigin Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result GitSetOrigin Source #

Command Ln Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result Ln Source #

Command Ls Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result Ls Source #

Command MkDir Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result MkDir Source #

Command Rm Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result Rm Source #

Command Touch Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result Touch Source #

Command Whoami Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result Whoami 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 #

Command (Find Dir) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Find Dir) Source #

Command (Find File) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Find File) Source #

Command (Mv Dir) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Mv Dir) Source #

Command (Mv File) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Mv File) Source #

Command (Readlink Dir) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Readlink Dir) Source #

Command (Readlink File) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Readlink File) Source #

data Whoami Source #

Unix whoami.

Constructors

Whoami 

Instances

Instances details
Show Whoami Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

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

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

newtype 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 Dir) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Mv Dir) Source #

Command (Mv File) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Mv File) Source #

type Result (Mv Dir) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

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

Defined in System.Hapistrano.Commands.Internal

type Result (Mv File) = ()

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 = ()

newtype 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 Dir) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Find Dir) Source #

Command (Find File) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result (Find File) Source #

type Result (Find Dir) Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

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

Defined in System.Hapistrano.Commands.Internal

newtype 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 = ()

newtype Cat Source #

Command used to read the contents of a particular file in the host.

Constructors

Cat (Path Abs File)

The absolute path to the file you want to read

Instances

Instances details
Command Cat Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result Cat Source #

type Result Cat Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

newtype CheckExists Source #

Command that checks for the existance of a particular file in the host.

Constructors

CheckExists (Path Abs File)

The absolute path to the file you want to check for existence

data BasicWrite Source #

Basic command that writes to a file some contents. It uses the file > contents shell syntax and the contents is represented as a String, so it shouldn't be used for bigger writing operations. Currently used to write fail or success to the .hapistrano_deploy_state file.

Constructors

BasicWrite 

Fields

  • (Path Abs File)

    The absolute path to the file to which you want to write

  • String

    The contents that will be written to the file

Instances

Instances details
Command BasicWrite Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

Associated Types

type Result BasicWrite Source #

type Result BasicWrite Source # 
Instance details

Defined in System.Hapistrano.Commands.Internal

type Result BasicWrite = ()

newtype 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 = ()

newtype GitSetOrigin Source #

Git set origin

Constructors

GitSetOrigin String 

newtype 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 = ()

newtype 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.