summaryrefslogtreecommitdiff
path: root/src/Propellor/CmdLine.hs
diff options
context:
space:
mode:
authorJoey Hess2014-11-22 15:58:09 -0400
committerJoey Hess2014-11-22 15:58:09 -0400
commit6d13790afa236b958eec9e8a0ea1e75125d90351 (patch)
tree36df89b0bb8bcf10f61a3b0914c5bf1ade7792a5 /src/Propellor/CmdLine.hs
parentadc7669b905b288d149710ea0dcb67d1d08a130b (diff)
propellor spin
Diffstat (limited to 'src/Propellor/CmdLine.hs')
-rw-r--r--src/Propellor/CmdLine.hs18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/Propellor/CmdLine.hs b/src/Propellor/CmdLine.hs
index ea6cabff..e719e149 100644
--- a/src/Propellor/CmdLine.hs
+++ b/src/Propellor/CmdLine.hs
@@ -156,14 +156,15 @@ updateFirst' cmdline next = ifM fetchOrigin
spin :: HostName -> Maybe HostName -> Host -> IO ()
spin target relay hst = do
- void $ actionMessage "Git commit" $
- gitCommit [Param "--allow-empty", Param "-a", Param "-m", Param "propellor spin"]
- -- Push to central origin repo first, if possible.
- -- The remote propellor will pull from there, which avoids
- -- us needing to send stuff directly to the remote host.
- whenM hasOrigin $
- void $ actionMessage "Push to central git repository" $
- boolSystem "git" [Param "push"]
+ unless relaying $ do
+ void $ actionMessage "Git commit" $
+ gitCommit [Param "--allow-empty", Param "-a", Param "-m", Param "propellor spin"]
+ -- Push to central origin repo first, if possible.
+ -- The remote propellor will pull from there, which avoids
+ -- us needing to send stuff directly to the remote host.
+ whenM hasOrigin $
+ void $ actionMessage "Push to central git repository" $
+ boolSystem "git" [Param "push"]
cacheparams <- toCommand <$> sshCachingParams hn
when (isJust relay) $
@@ -179,6 +180,7 @@ spin target relay hst = do
where
hn = fromMaybe target relay
user = "root@"++hn
+ relaying = relay == Just target
mkcmd = shellWrap . intercalate " ; "