mirror of
https://github.com/stackbuilders/hapistrano.git
synced 2024-10-03 19:07:15 +03:00
doc: Include docs for initConfig (#231)
* doc: Include docs for initConfig * doc: Update missing documentation * ref: Increase boundaries for some dependencies * doc: Modify documentation
This commit is contained in:
parent
a2aa3dba43
commit
27511ae969
@ -59,12 +59,12 @@ library
|
||||
, gitrev >= 1.2 && < 1.4
|
||||
, mtl >= 2.0 && < 3.0
|
||||
, stm >= 2.0 && < 2.6
|
||||
, path >= 0.5 && < 0.9
|
||||
, path-io >= 1.2 && < 1.7
|
||||
, path >= 0.5 && < 1.0
|
||||
, path-io >= 1.2 && < 1.9
|
||||
, process >= 1.4 && < 1.7
|
||||
, text >= 1.2 && < 3
|
||||
, typed-process >= 0.2 && < 0.3
|
||||
, time >= 1.5 && < 1.11
|
||||
, time >= 1.5 && < 1.13
|
||||
, transformers >= 0.4 && < 0.6
|
||||
, exceptions >= 0.10 && < 0.11
|
||||
, yaml >= 0.11.7 && < 0.12
|
||||
@ -110,8 +110,8 @@ test-suite test
|
||||
, hapistrano
|
||||
, hspec >= 2.0 && < 3.0
|
||||
, mtl >= 2.0 && < 3.0
|
||||
, path >= 0.5 && < 0.9
|
||||
, path-io >= 1.2 && < 1.7
|
||||
, path
|
||||
, path-io
|
||||
, process >= 1.4 && < 1.7
|
||||
, QuickCheck >= 2.5.1 && < 3.0
|
||||
, silently >= 1.2 && < 1.3
|
||||
|
@ -51,18 +51,16 @@ import qualified Data.Yaml as Yaml
|
||||
import Numeric.Natural
|
||||
import Path
|
||||
import Path.IO
|
||||
import System.Hapistrano.Commands
|
||||
import System.Hapistrano.Config ( BuildCommand (..)
|
||||
, CopyThing (..)
|
||||
, ExecutionMode (..)
|
||||
, deployStateFilename
|
||||
)
|
||||
import qualified System.Hapistrano.Config as HC
|
||||
import System.Hapistrano.Core
|
||||
import System.Hapistrano.Types
|
||||
import qualified System.Directory as Directory
|
||||
import System.Exit (exitFailure)
|
||||
import qualified System.FilePath as FilePath
|
||||
import System.Hapistrano.Commands
|
||||
import qualified System.Hapistrano.Config as HC
|
||||
import System.Hapistrano.Config (BuildCommand (..), CopyThing (..),
|
||||
ExecutionMode (..),
|
||||
deployStateFilename)
|
||||
import System.Hapistrano.Core
|
||||
import System.Hapistrano.Types
|
||||
import System.IO (stderr)
|
||||
import Text.Read (readMaybe)
|
||||
|
||||
@ -271,6 +269,8 @@ playScriptLocally cmds =
|
||||
}) $
|
||||
forM_ cmds $ flip execWithInheritStdout Nothing
|
||||
|
||||
-- | Create a file with an initial config file by getting information from the
|
||||
-- user.
|
||||
initConfig :: IO String -> IO ()
|
||||
initConfig getLine' = do
|
||||
configFilePath <- (FilePath.</> "hap.yml") <$> Directory.getCurrentDirectory
|
||||
|
@ -31,13 +31,13 @@ import Data.Aeson.Types (typeMismatch)
|
||||
import Data.Function (on)
|
||||
import Data.List (nubBy)
|
||||
import Data.Maybe (maybeToList)
|
||||
import Data.Yaml
|
||||
import Data.Proxy
|
||||
import Data.Yaml
|
||||
import Numeric.Natural
|
||||
import Path
|
||||
import System.Hapistrano.Commands
|
||||
import System.Hapistrano.Types (ReleaseFormat(..), Shell(..),
|
||||
Source(..), TargetSystem(..))
|
||||
import System.Hapistrano.Types (ReleaseFormat (..), Shell (..),
|
||||
Source (..), TargetSystem (..))
|
||||
|
||||
-- | Hapistrano configuration typically loaded from @hap.yaml@ file.
|
||||
|
||||
@ -104,11 +104,14 @@ data Target =
|
||||
, targetSshArgs :: [String]
|
||||
} deriving (Eq, Ord, Show)
|
||||
|
||||
-- | Command and execution mode for build command.
|
||||
data BuildCommand = BuildCommand
|
||||
{ buildCommandCommand :: GenericCommand
|
||||
, buildCommandExecutionMode :: ExecutionMode
|
||||
} deriving (Eq, Ord, Show)
|
||||
|
||||
-- | The execution mode determines whether commands will be executed
|
||||
-- on the lead target or on all targets.
|
||||
data ExecutionMode = LeadTarget | AllTargets
|
||||
deriving (Eq, Ord, Show)
|
||||
|
||||
|
@ -228,6 +228,7 @@ data InitTemplateConfig = InitTemplateConfig
|
||||
, restartCommand :: Maybe T.Text
|
||||
}
|
||||
|
||||
-- | Default initial template for creating hapistrano file.
|
||||
defaultInitTemplateConfig :: IO InitTemplateConfig
|
||||
defaultInitTemplateConfig = do
|
||||
let shellWithDefault d cmd = do
|
||||
|
Loading…
Reference in New Issue
Block a user