summaryrefslogtreecommitdiff
path: root/src/Propellor/CmdLine.hs
diff options
context:
space:
mode:
authorJoey Hess2014-11-18 17:10:10 -0400
committerJoey Hess2014-11-18 17:10:10 -0400
commit4f352327be32b045585cf134446613e0be625e80 (patch)
tree8637b35fc0fe3672eca94152c7cfeb705fa11ca5 /src/Propellor/CmdLine.hs
parentef9e9375e3bcd7e6907b5022dfe07a38fe57aa4d (diff)
propellor spin
Diffstat (limited to 'src/Propellor/CmdLine.hs')
-rw-r--r--src/Propellor/CmdLine.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Propellor/CmdLine.hs b/src/Propellor/CmdLine.hs
index 18c88f65..e7da0a80 100644
--- a/src/Propellor/CmdLine.hs
+++ b/src/Propellor/CmdLine.hs
@@ -195,7 +195,12 @@ getCurrentGitSha1 branchref = readProcess "git" ["show-ref", "--hash", branchref
spin :: HostName -> Host -> IO ()
spin hn hst = do
void $ gitCommit [Param "--allow-empty", Param "-a", Param "-m", Param "propellor spin"]
- void $ boolSystem "git" [Param "push"]
+ -- 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 $ boolSystem "git" [Param "push"]
+
cacheparams <- toCommand <$> sshCachingParams hn
comm cacheparams =<< hostprivdata
unlessM (boolSystem "ssh" (map Param (cacheparams ++ ["-t", user, runcmd]))) $