on master help sign in
ob deploy push: Ensure configuration directory is clean before proceeding
commitc17fb764088fe5f0f1671c5be4885f6273906ce3 authorLuigy Leon <luigy@outlook.com> dateTue 8 May 2018, 14:37 (8 years ago) parenta5c7e20
1 file changed+6
lib/command/src/Obelisk/Command.hs+6
lib/command/src/Obelisk/Command.hs+6
@@ -100,6 +100,7 @@ obCommand = hsubparser
100100deployCommand :: Parser DeployCommand
101101deployCommand = hsubparser $ mconcat
102102 [ command "init" $ info deployInitCommand $ progDesc "Initialize a deployment configuration directory"
103+ , command "push" $ info (pure DeployCommand_Push) mempty
103104 ]
104105
105106deployInitCommand :: Parser DeployCommand
@@ -111,6 +112,7 @@ deployInitCommand = fmap DeployCommand_Init $ DeployInitOpts
111112
112113data DeployCommand
113114 = DeployCommand_Init DeployInitOpts
115+ | DeployCommand_Push
114116
115117data DeployInitOpts = DeployInitOpts
116118 { _deployInitOpts_ouputDir :: FilePath
@@ -205,6 +207,10 @@ ob = \case
205207 sshKeyPath = _deployInitOpts_sshKey deployOpts
206208 hostname = _deployInitOpts_hostname deployOpts
207209 deployInit thunkPtr (root </> "config") deployDir sshKeyPath hostname
210+ DeployCommand_Push -> do
211+ checkGitCleanStatus "." >>= \case
212+ True -> return ()
213+ False -> fail "ob push: Commit any changes to the deployment configuration before proceeding"
208214 ObCommand_Run -> inNixShell' $ static run
209215 -- inNixShell ($(mkClosure 'ghcidAction) ())
210216 ObCommand_Thunk tc -> case tc of