propellor spin

This commit is contained in:
Joey Hess 2014-04-04 15:47:06 -04:00
parent b9e7721db0
commit e6d9c792e7
Failed to extract signature
2 changed files with 11 additions and 16 deletions

View File

@ -233,23 +233,19 @@ runningContainer cid@(ContainerId hn cn) image containerprops = containerDesc ci
else do else do
error "container parameters changed" error "container parameters changed"
void $ stopContainer cid void $ stopContainer cid
oldimage <- fromMaybe image <$> commitContainer cid restartcontainer
void $ removeContainer cid else ifM (elem cid <$> listContainers AllContainers)
go oldimage ( restartcontainer
else do , go image
ifM (elem cid <$> listContainers AllContainers) )
( do
-- Contaner may be stopped, or
-- may not exist.
void $ stopContainer cid
oldimage <- fromMaybe image <$> commitContainer cid
void $ removeContainer cid
go oldimage
, go image
)
where where
ident = ContainerIdent image hn cn runps ident = ContainerIdent image hn cn runps
restartcontainer = do
oldimage <- fromMaybe image <$> commitContainer cid
void $ removeContainer cid
go oldimage
getrunningident :: IO (Maybe ContainerIdent) getrunningident :: IO (Maybe ContainerIdent)
getrunningident = simpleShClient (namedPipe cid) "cat" [propellorIdent] $ \rs -> do getrunningident = simpleShClient (namedPipe cid) "cat" [propellorIdent] $ \rs -> do
print (rs, extractident rs) print (rs, extractident rs)

View File

@ -36,7 +36,6 @@ host hostname@"clam.kitenet.net" = standardSystem Unstable $ props
& Tor.isBridge & Tor.isBridge
& JoeySites.oldUseNetshellBox & JoeySites.oldUseNetshellBox
& Docker.configured & Docker.configured
! Docker.docked container hostname "amd64-git-annex-builder"
& Docker.garbageCollected & Docker.garbageCollected
-- Orca is the main git-annex build box. -- Orca is the main git-annex build box.
host hostname@"orca.kitenet.net" = standardSystem Unstable $ props host hostname@"orca.kitenet.net" = standardSystem Unstable $ props
@ -45,7 +44,7 @@ host hostname@"orca.kitenet.net" = standardSystem Unstable $ props
& Docker.configured & Docker.configured
& Apt.buildDep ["git-annex"] & Apt.buildDep ["git-annex"]
& Docker.docked container hostname "amd64-git-annex-builder" & Docker.docked container hostname "amd64-git-annex-builder"
& Docker.docked container hostname "i386-git-annex-builder" ! Docker.docked container hostname "i386-git-annex-builder"
& Docker.garbageCollected & Docker.garbageCollected
-- My laptop -- My laptop
host _hostname@"darkstar.kitenet.net" = Just $ props host _hostname@"darkstar.kitenet.net" = Just $ props