diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Propellor/Bootstrap.hs | 4 | ||||
| -rw-r--r-- | src/Propellor/Property/Cron.hs | 6 | ||||
| -rw-r--r-- | src/Propellor/Spin.hs | 4 |
3 files changed, 8 insertions, 6 deletions
diff --git a/src/Propellor/Bootstrap.hs b/src/Propellor/Bootstrap.hs index 58480832..633a2ff4 100644 --- a/src/Propellor/Bootstrap.hs +++ b/src/Propellor/Bootstrap.hs @@ -15,8 +15,8 @@ type ShellCommand = String -- Shell command line to ensure propellor is bootstrapped and ready to run. -- Should be run inside the propellor config dir, and will install -- all necessary build dependencies and build propellor. -bootstrapPropellorCommand :: System -> ShellCommand -bootstrapPropellorCommand sys = checkDepsCommand sys ++ +bootstrapPropellorCommand :: Maybe System -> ShellCommand +bootstrapPropellorCommand msys = maybe "true" checkDepsCommand msys ++ "&& if ! test -x ./propellor; then " ++ buildCommand ++ "; fi;" ++ checkBinaryCommand diff --git a/src/Propellor/Property/Cron.hs b/src/Propellor/Property/Cron.hs index a6ab3eca..365e2903 100644 --- a/src/Propellor/Property/Cron.hs +++ b/src/Propellor/Property/Cron.hs @@ -81,5 +81,7 @@ niceJob desc times user cddir command = job desc times user cddir -- | Installs a cron job to run propellor. runPropellor :: Times -> Property NoInfo -runPropellor times = niceJob "propellor" times (User "root") localdir "true" --- (bootstrapPropellorCommand ++ "; ./propellor") +runPropellor times = withOS "propellor cron job" $ \o -> + ensureProperty $ + niceJob "propellor" times (User "root") localdir + (bootstrapPropellorCommand o ++ "; ./propellor") diff --git a/src/Propellor/Spin.hs b/src/Propellor/Spin.hs index a2afe29f..2c57f57d 100644 --- a/src/Propellor/Spin.hs +++ b/src/Propellor/Spin.hs @@ -84,7 +84,7 @@ spin' mprivdata relay target hst = do -- Install, or update the remote propellor. updateServer target relay hst (proc "ssh" $ cacheparams ++ [sshtarget, shellWrap (probecmd o)]) - (proc "ssh" $ cacheparams ++ [sshtarget, shellWrap (updatecmd o)]) + (proc "ssh" $ cacheparams ++ [sshtarget, shellWrap (updatecmd (Just o))]) =<< getprivdata -- And now we can run it. @@ -102,7 +102,7 @@ spin' mprivdata relay target hst = do [ installGitCommand sys , "echo " ++ toMarked statusMarker (show NeedGitClone) ] ++ ") || echo " ++ toMarked statusMarker (show NeedPrecompiled) - , "else " ++ (updatecmd sys) + , "else " ++ (updatecmd (Just sys)) , "fi" ] |
