34 lines
841 B
Haskell
34 lines
841 B
Haskell
|
|
module Main where
|
||
|
|
|
||
|
|
import MiniValidation.Manifest
|
||
|
|
( Validation (Failure, Success)
|
||
|
|
, readRawManifest
|
||
|
|
, renderManifest
|
||
|
|
, renderValidationErrors
|
||
|
|
, validateManifest
|
||
|
|
)
|
||
|
|
import System.Environment (getArgs)
|
||
|
|
import System.Exit (die)
|
||
|
|
|
||
|
|
main :: IO ()
|
||
|
|
main = do
|
||
|
|
args <- getArgs
|
||
|
|
let inputArgs =
|
||
|
|
case args of
|
||
|
|
[] ->
|
||
|
|
[ "service=api-gateway"
|
||
|
|
, "env=production"
|
||
|
|
, "owners=platform,security"
|
||
|
|
, "replicas=3"
|
||
|
|
, "strategy=canary:20"
|
||
|
|
, "window=22-24"
|
||
|
|
]
|
||
|
|
_ -> args
|
||
|
|
|
||
|
|
case readRawManifest inputArgs of
|
||
|
|
Left err -> die err
|
||
|
|
Right rawManifest ->
|
||
|
|
case validateManifest rawManifest of
|
||
|
|
Failure validationErrors -> die (renderValidationErrors validationErrors)
|
||
|
|
Success manifest -> putStrLn (renderManifest manifest)
|