chore(status): show environment variable VERSION_NR
This commit is contained in:
parent
73a62a653b
commit
96a81cf85d
@ -17,6 +17,8 @@ import qualified Data.Set as Set
|
|||||||
|
|
||||||
import Control.Concurrent.STM.Delay
|
import Control.Concurrent.STM.Delay
|
||||||
|
|
||||||
|
import System.Environment (lookupEnv) -- while git version number is not working
|
||||||
|
|
||||||
-- import Data.FileEmbed (embedStringFile)
|
-- import Data.FileEmbed (embedStringFile)
|
||||||
|
|
||||||
getHealthR :: Handler TypedContent
|
getHealthR :: Handler TypedContent
|
||||||
@ -107,7 +109,7 @@ getInstanceR = do
|
|||||||
getStatusR :: Handler Html
|
getStatusR :: Handler Html
|
||||||
getStatusR = do
|
getStatusR = do
|
||||||
starttime <- getsYesod appStartTime
|
starttime <- getsYesod appStartTime
|
||||||
currtime <- liftIO getCurrentTime
|
(currtime, env_version) <- liftIO $ (,) <$> getCurrentTime <*> lookupEnv "VERSION_NR"
|
||||||
-- ft <- formatTime' "%Y-%m-%d %H:%M:%S" currtime
|
-- ft <- formatTime' "%Y-%m-%d %H:%M:%S" currtime
|
||||||
withUrlRenderer
|
withUrlRenderer
|
||||||
[hamlet|
|
[hamlet|
|
||||||
@ -116,6 +118,9 @@ getStatusR = do
|
|||||||
<head>
|
<head>
|
||||||
<title>Status
|
<title>Status
|
||||||
<body>
|
<body>
|
||||||
|
$maybe env_ver <- env_version
|
||||||
|
<p>
|
||||||
|
Environment version #{env_ver}
|
||||||
<p>
|
<p>
|
||||||
Current Time <br>
|
Current Time <br>
|
||||||
#{show currtime} <br>
|
#{show currtime} <br>
|
||||||
|
|||||||
Reference in New Issue
Block a user