Merge pull request #59 from stackbuilders/fix-some-issues

Fix some issues
This commit is contained in:
Mark Karpov 2017-02-21 22:07:57 +04:00 committed by GitHub
commit 754f0f6c98
4 changed files with 25 additions and 11 deletions

View File

@ -1,3 +1,12 @@
## 0.3.0.1
* Reduced verbosity of some commands to make reading logs easier.
* Restart command is now invoked after activation of new release (is it
should).
* Fix a typo in flag that specifies SSH port for `scp`.
* Ensure that containing directories for files and directories to copy
exist before invoking `scp`.
## 0.3.0.0
* Add proper set of dependency version constraints.

View File

@ -13,10 +13,11 @@ import Path.IO
import Paths_hapistrano (version)
import System.Exit
import System.Hapistrano.Types
import qualified Config as C
import qualified Data.Yaml as Yaml
import qualified System.Hapistrano as Hap
import qualified System.Hapistrano.Core as Hap
import qualified Config as C
import qualified Data.Yaml as Yaml
import qualified System.Hapistrano as Hap
import qualified System.Hapistrano.Commands as Hap
import qualified System.Hapistrano.Core as Hap
#if !MIN_VERSION_base(4,8,0)
import Control.Applicative
@ -122,16 +123,20 @@ main = do
forM_ configCopyFiles $ \(C.CopyThing src dest) -> do
srcPath <- resolveFile' src
destPath <- parseRelFile dest
Hap.scpFile srcPath (rpath </> destPath)
let dpath = rpath </> destPath
(Hap.exec . Hap.MkDir . parent) dpath
Hap.scpFile srcPath dpath
forM_ configCopyDirs $ \(C.CopyThing src dest) -> do
srcPath <- resolveDir' src
destPath <- parseRelDir dest
Hap.scpDir srcPath (rpath </> destPath)
let dpath = rpath </> destPath
(Hap.exec . Hap.MkDir . parent) dpath
Hap.scpDir srcPath dpath
forM_ configBuildScript (Hap.playScript configDeployPath release)
forM_ configRestartCommand Hap.exec
Hap.registerReleaseAsComplete configDeployPath release
Hap.activateRelease configDeployPath release
Hap.dropOldReleases configDeployPath n
forM_ configRestartCommand Hap.exec
Rollback n -> do
Hap.rollback configDeployPath n
forM_ configRestartCommand Hap.exec

View File

@ -103,7 +103,7 @@ data Rm where
instance Command Rm where
type Result Rm = ()
renderCommand (Rm path) = formatCmd "rm"
[ Just "-rfv"
[ Just "-rf"
, Just (toFilePath path) ]
parseResult Proxy _ = ()

View File

@ -80,7 +80,7 @@ scpFile
-> Path Abs File -- ^ Where to put the file on target machine
-> Hapistrano ()
scpFile src dest =
scp' (fromAbsFile src) (fromAbsFile dest) ["-qv"]
scp' (fromAbsFile src) (fromAbsFile dest) ["-q"]
-- | Copy a local directory recursively to target server.
@ -89,7 +89,7 @@ scpDir
-> Path Abs Dir -- ^ Where to put the dir on target machine
-> Hapistrano ()
scpDir src dest =
scp' (fromAbsDir src) (fromAbsDir dest) ["-qvr"]
scp' (fromAbsDir src) (fromAbsDir dest) ["-qr"]
scp'
:: FilePath
@ -102,7 +102,7 @@ scp' src dest extraArgs = do
portArg =
case sshPort <$> configSshOptions of
Nothing -> []
Just x -> ["-p", show x]
Just x -> ["-P", show x]
hostPrefix =
case sshHost <$> configSshOptions of
Nothing -> ""