Merge pull request #87 from stackbuilders/version_details

When showing version information also show git branch and commit
This commit is contained in:
Götz Christ 2017-12-28 10:20:17 -05:00 committed by GitHub
commit d881b1e641
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 112 additions and 100 deletions

View File

@ -1,3 +1,7 @@
## 0.3.5.1
* Standarize style
* When showing version information also show git branch and commit
## 0.3.5.0
* Add support for deploying to other Unix systems, besides GNU/Linux which
didn't supported all the flags that Hapistrano was using. See issue #63

View File

@ -16,7 +16,7 @@ import Data.Maybe (maybeToList)
import Data.Yaml
import Path
import System.Hapistrano.Commands
import System.Hapistrano.Types (TargetSystem(..))
import System.Hapistrano.Types (TargetSystem (..))
-- | Hapistrano configuration typically loaded from @hap.yaml@ file.

View File

@ -1,30 +1,29 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TemplateHaskell #-}
module Main (main) where
import qualified Config as C
import Control.Concurrent.Async
import Control.Concurrent.STM
import Control.Monad
import Data.Monoid ((<>))
import Data.Version (showVersion)
import qualified Data.Yaml as Yaml
import Development.GitRev
import Formatting
import Numeric.Natural
import Options.Applicative hiding (str)
import Path
import Path.IO
import Paths_hapistrano (version)
import System.Exit
import System.Hapistrano.Types
import System.IO
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
#endif
import System.Hapistrano.Types
import System.IO
----------------------------------------------------------------------------
-- Command line options
@ -51,10 +50,15 @@ parserInfo =
header "Hapistrano - A deployment library for Haskell applications")
where
versionOption :: Parser (a -> a)
versionOption =
infoOption
versionOption = infoOption
(formatToString
("Hapistrano: "% string
% "\nbranch: " % string
% "\nrevision: " % string)
(showVersion version)
(long "version" <> short 'v' <> help "Show version of the program")
$(gitBranch)
$(gitHash))
(long "version" <> short 'v' <> help "Show version information")
optionParser :: Parser Opts
optionParser = Opts
@ -176,7 +180,7 @@ main = do
xs ->
let f (host, port) = SshOptions host port
in hap . Just . f <$> xs
results <- (runConcurrently . sequenceA . fmap Concurrently)
results <- (runConcurrently . traverse Concurrently)
((Right () <$ printer (length haps)) : haps)
case sequence_ results of
Left n -> exitWith (ExitFailure n)

View File

@ -1,5 +1,5 @@
name: hapistrano
version: 0.3.5.0
version: 0.3.5.1
synopsis: A deployment library for Haskell applications
description:
.
@ -45,6 +45,8 @@ library
, System.Hapistrano.Types
build-depends: base >= 4.8 && < 5.0
, filepath >= 1.2 && < 1.5
, formatting >= 6.2 && < 7.0
, gitrev >= 1.2 && < 1.4
, mtl >= 2.0 && < 3.0
, path >= 0.5 && < 0.7
, process >= 1.4 && < 1.7
@ -64,6 +66,8 @@ executable hap
build-depends: aeson >= 0.11 && < 1.3
, async >= 2.0.1.6 && < 2.2
, base >= 4.8 && < 5.0
, formatting >= 6.2 && < 7.0
, gitrev >= 1.2 && < 1.4
, hapistrano
, optparse-applicative >= 0.11 && < 0.15
, path >= 0.5 && < 0.7

View File

@ -6,16 +6,16 @@ where
import Control.Monad
import Control.Monad.Reader
import Data.Maybe (catMaybes)
import Path
import Path.IO
import Data.Maybe (catMaybes)
import qualified System.Hapistrano as Hap
import qualified System.Hapistrano.Commands as Hap
import qualified System.Hapistrano.Core as Hap
import System.Hapistrano.Types
import System.Info (os)
import System.IO
import Test.Hspec hiding (shouldBe, shouldReturn)
import qualified System.Hapistrano as Hap
import qualified System.Hapistrano.Commands as Hap
import qualified System.Hapistrano.Core as Hap
import qualified Test.Hspec as Hspec
testBranchName :: String

View File

@ -32,16 +32,16 @@ where
import Control.Monad
import Control.Monad.Except
import Data.List (genericDrop, dropWhileEnd, sortBy)
import Control.Monad.Reader (local)
import Data.List (dropWhileEnd, genericDrop, sortBy)
import Data.Maybe (mapMaybe)
import Data.Ord (comparing, Down (..))
import Data.Ord (Down (..), comparing)
import Data.Time
import Numeric.Natural
import Path
import System.Hapistrano.Commands
import System.Hapistrano.Core
import System.Hapistrano.Types
import Control.Monad.Reader (local)
----------------------------------------------------------------------------
-- High-level functionality

View File

@ -40,12 +40,12 @@ where
import Control.Monad.IO.Class
import Data.Char (isSpace)
import Data.List (dropWhileEnd)
import Data.Maybe (catMaybes, mapMaybe, fromJust)
import Data.Maybe (catMaybes, fromJust, mapMaybe)
import Data.Proxy
import Numeric.Natural
import Path
import System.Hapistrano.Types (TargetSystem(..))
import System.Hapistrano.Types (TargetSystem (..))
----------------------------------------------------------------------------
-- Commands

View File

@ -1,3 +1,3 @@
resolver: lts-9.0
resolver: lts-9.20
packages:
- '.'