hapistrano- A deployment library for Haskell applications

Safe HaskellSafe-Inferred



A module for easily creating reliable deploy processes for Haskell applications.



data Config Source

Config stuff that will be replaced by config file reading




deployPath :: String

The root of the deploy target on the remote host

repository :: String

The remote git repo

revision :: String

A SHA1 or branch to release

releaseFormat :: ReleaseFormat
host :: Maybe String

The target host for the deploy, or Nothing to indicate that operations should be done directly in the local deployPath without going over SSH

buildScript :: Maybe FilePath

The local path to a file that should be executed on the remote server to build the application.

restartCommand :: Maybe String

Optional command to restart the server after a successful deploy


data ReleaseFormat Source



Standard release path following Capistrano's format


Long release path including picoseconds for testing or people seriously into continuous deployment


activateRelease :: Release -> Hapistrano String Source

Switches the current symlink to point to the release specified in the configuration. Maybe used in either deploy or rollback cases.

currentPath Source


:: FilePath

The full path of the deploy folder root

-> FilePath

The full path to the current symlink

Returns the full path to the current symlink.

defaultSuccessHandler :: a -> ReaderT Config IO () Source

Default method to run on deploy success.

defaultErrorHandler :: FailureResult -> ReaderT Config IO () Source

Default method to run on deploy failure. Emits a failure message and exits with a status code of 1.

isReleaseString Source


:: ReleaseFormat

Format of Release directories

-> String

String to check against Release format

-> Bool

Whether the given String adheres to the specified Release format

Returns a Bool indicating if the given String is in the proper release format.

pathToRelease Source


:: FilePath

The entire FilePath to a Release directory

-> Release

The Release number.

Take the release timestamp from the end of a filepath.

pushRelease :: Hapistrano Release Source

Does basic project setup for a project, including making sure some directories exist, and pushing a new release directory with the SHA1 or branch specified in the configuration.

readCurrentLink Source


:: Hapistrano FilePath

The target of the symlink in the Hapistrano monad

Trims any newlines from the given String

Returns the FilePath pointed to by the current symlink.

restartServerCommand :: Hapistrano String Source

Runs a command to restart a server if a command is provided.

rollback Source


:: Hapistrano String

The current Release in the Hapistrano monad

Activates the previous detected release.

runRC Source


:: ((Int, String) -> ReaderT Config IO a)

Error handler

-> (a -> ReaderT Config IO a)

Success handler

-> Config

Hapistrano deployment configuration

-> Hapistrano a

The remote command to run

-> IO a 

Runs the deploy, along with an optional success or failure function.

runBuild :: Release -> Hapistrano Release Source

Runs a build script if one is provided.