propellor spin

This commit is contained in:
Joey Hess 2014-11-18 15:17:12 -04:00
parent 9dfae00bd3
commit 573c6ab4b8
Failed to extract signature
2 changed files with 6 additions and 9 deletions

View File

@ -202,7 +202,6 @@ spin hn hst = do
go cacheparams privdata = withBothHandles createProcessSuccess (proc "ssh" $ cacheparams ++ [user, bootstrapcmd]) $ \(toh, fromh) -> do go cacheparams privdata = withBothHandles createProcessSuccess (proc "ssh" $ cacheparams ++ [user, bootstrapcmd]) $ \(toh, fromh) -> do
let loop = do let loop = do
status <- getMarked fromh statusMarker status <- getMarked fromh statusMarker
print (">>", status)
case readish =<< status of case readish =<< status of
Just NeedRepoUrl -> do Just NeedRepoUrl -> do
sendMarked toh repoUrlMarker sendMarked toh repoUrlMarker
@ -299,7 +298,7 @@ boot = do
hClose stdin hClose stdin
hout <- dup stdOutput hout <- dup stdOutput
hClose stdout hClose stdout
unlessM (boolSystem "git" [Param "pull", Param $ "--upload=pack=./propellor gitpush " ++ show hin ++ " " ++ show hout, Param "."]) $ unlessM (boolSystem "git" [Param "pull", Param $ "--upload=pack=./propellor --gitpush " ++ show hin ++ " " ++ show hout, Param "."]) $
warningMessage "git pull from client failed" warningMessage "git pull from client failed"
-- Shim for git push over the propellor ssh channel. -- Shim for git push over the propellor ssh channel.

View File

@ -47,13 +47,11 @@ getMarked :: Handle -> Marker -> IO (Maybe String)
getMarked h marker = go =<< catchMaybeIO (hGetLine h) getMarked h marker = go =<< catchMaybeIO (hGetLine h)
where where
go Nothing = return Nothing go Nothing = return Nothing
go (Just l) = do go (Just l) = case fromMarked marker l of
hPutStrLn stderr $ show ("got ", l) Nothing -> do
case fromMarked marker l of putStrLn l
Nothing -> do getMarked h marker
putStrLn l Just v -> return (Just v)
getMarked h marker
Just v -> return (Just v)
req :: Stage -> Marker -> (String -> IO ()) -> IO () req :: Stage -> Marker -> (String -> IO ()) -> IO ()
req stage marker a = do req stage marker a = do