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

Contents

Description

A module for creating reliable deploy processes for Haskell applications.

Synopsis

Documentation

runHapistrano Source #

Arguments

:: MonadIO m 
=> Maybe SshOptions

SSH options to use or Nothing if we run locally

-> Shell

Shell to run commands

-> (OutputDest -> String -> IO ())

How to print messages

-> Hapistrano a

The computation to run

-> m (Either Int a)

Status code in Left on failure, result in Right on success

Run the Hapistrano monad. The monad hosts exec actions.

pushRelease :: Task -> Hapistrano Release Source #

Perform basic setup for a project, making sure necessary directories exist and pushing a new release directory with the SHA1 or branch specified in the configuration. Return identifier of the pushed release.

pushReleaseWithoutVc :: Task -> Hapistrano Release Source #

Same as pushRelease but doesn't perform any version control related operations.

activateRelease Source #

Arguments

:: TargetSystem 
-> Path Abs Dir

Deploy path

-> Release

Release identifier to activate

-> Hapistrano () 

Switch the current symlink to point to the specified release. May be used in deploy or rollback cases.

linkToShared Source #

Arguments

:: TargetSystem

System to deploy

-> Path Abs Dir

Release path

-> Path Abs Dir

Deploy path

-> FilePath

Thing to link in share

-> Maybe Release

Release that was being attempted, if it was defined

-> Hapistrano () 

Link something (file or directory) from the {deploy_path}shared directory to a release

createHapistranoDeployState Source #

Arguments

:: Path Abs Dir

Deploy path

-> Release

Release being deployed

-> DeployState

Indicates how the deployment went

-> Hapistrano () 

Creates the file .hapistrano__state containing fail or success depending on how the deployment ended.

deploy Source #

Arguments

:: Config

Deploy configuration

-> ReleaseFormat

Long or Short format

-> Natural

Number of releases to keep

-> Bool

Wheter we should keep one failed release or not

-> Hapistrano () 

Deploys a new release

rollback Source #

Arguments

:: TargetSystem 
-> Path Abs Dir

Deploy path

-> Natural

How many releases back to go, 0 re-activates current

-> Maybe GenericCommand

Restart command

-> Hapistrano () 

Activates one of already deployed releases.

dropOldReleases Source #

Arguments

:: Path Abs Dir

Deploy path

-> Natural

How many releases to keep

-> Bool

Whether the --keep-one-failed flag is present or not

-> Hapistrano () 

Remove older releases to avoid filling up the target host filesystem.

playScript Source #

Arguments

:: Path Abs Dir

Deploy path

-> Release

Release identifier

-> Maybe (Path Rel Dir)

Working directory

-> [GenericCommand]

Commands to execute

-> Hapistrano () 

Play the given script switching to directory of given release.

playScriptLocally :: [GenericCommand] -> Hapistrano () Source #

Plays the given script on your machine locally.

Path helpers

releasePath Source #

Arguments

:: Path Abs Dir

Deploy path

-> Release

Release identifier

-> Maybe (Path Rel Dir)

Working directory

-> Hapistrano (Path Abs Dir) 

Construct path to a particular Release.

sharedPath Source #

Arguments

:: Path Abs Dir

Deploy path

-> Path Abs Dir 

Return the full path to the directory containing the shared files/directories.

currentSymlinkPath Source #

Arguments

:: Path Abs Dir

Deploy path

-> Path Abs File 

Get full path to current symlink.

tempSymlinkPath Source #

Arguments

:: Path Abs Dir

Deploy path

-> Path Abs File 

Get full path to temp symlink.

deployState Source #

Arguments

:: Path Abs Dir

Deploy path

-> Maybe (Path Rel Dir)

Working directory

-> Release

Release identifier

-> Hapistrano DeployState

Whether the release was deployed successfully or not

Checks if a release was deployed properly or not by looking into the .hapistrano_deploy_state file. If the file doesn't exist or the contents are anything other than Fail or Success, it returns Nothing.