From 4f352327be32b045585cf134446613e0be625e80 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 18 Nov 2014 17:10:10 -0400 Subject: propellor spin --- src/Propellor/CmdLine.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') 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]))) $ -- cgit v1.2.3