packages feed

hapistrano 0.3.9.0 → 0.3.9.1

raw patch · 4 files changed

+20/−5 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,3 +1,12 @@+## 0.3.9.1+### Added+* Add timestamp to output commands:+```+[16:29:58,  2019-01-23 (-05)] INFO -- : $ find /tmp/hapistrano/releases/ -maxdepth 1 -type d+/tmp/hapistrano/releases/+/tmp/hapistrano/releases/20190123212933+```+ ## 0.3.9.0 ### Added * Support to deploy to a host that has default `zsh` shell.
hapistrano.cabal view
@@ -1,5 +1,5 @@ name:                hapistrano-version:             0.3.9.0+version:             0.3.9.1 synopsis:            A deployment library for Haskell applications description:   .
spec/System/HapistranoSpec.hs view
@@ -6,6 +6,7 @@  import           Control.Monad import           Control.Monad.Reader+import           Data.List                  (isPrefixOf) import           Data.Maybe                 (catMaybes) import           Numeric.Natural import           Path@@ -33,10 +34,10 @@       it "redirects commands' output to stdout first" $         let (Just commandTest) = Hap.mkGenericCommand "echo \"hapistrano\"; sleep 2; echo \"onartsipah\""             commandExecution = Hap.execWithInheritStdout commandTest-            expectedOutput = "hapistrano\nonartsipah\n*** localhost ******************************************************************\n$ echo \"hapistrano\"; sleep 2; echo \"onartsipah\"\n"+            expectedOutput = "hapistrano\nonartsipah"          in do            actualOutput <- capture_ (runHap commandExecution)-           actualOutput `Hspec.shouldBe` expectedOutput+           expectedOutput `Hspec.shouldSatisfy` (`isPrefixOf` actualOutput)    describe "readScript" $     it "performs all the necessary normalizations correctly" $ do
src/System/Hapistrano/Core.hs view
@@ -28,6 +28,7 @@ import           Control.Monad.Reader import           Control.Concurrent.STM (atomically) import           Data.Proxy+import           Data.Time import           Path import           System.Exit import           System.Hapistrano.Commands@@ -163,11 +164,15 @@   -> Hapistrano String -- ^ Raw stdout output of that program exec' cmd readProcessOutput = do   Config {..} <- ask-  let hostLabel =+  time <- liftIO getZonedTime++  let timeStampFormat = "%T,  %F (%Z)"+      printableTime = formatTime defaultTimeLocale timeStampFormat time+      hostLabel =         case configSshOptions of           Nothing              -> "localhost"           Just SshOptions {..} -> sshHost ++ ":" ++ show sshPort-  liftIO $ configPrint StdoutDest (putLine hostLabel ++ "$ " ++ cmd ++ "\n")+  liftIO $ configPrint StdoutDest (putLine hostLabel ++ "[" ++ printableTime ++ "] INFO -- : " ++ "$ " ++ cmd ++ "\n")   (exitCode', stdout', stderr') <- liftIO readProcessOutput   unless (null stdout') . liftIO $     configPrint StdoutDest stdout'