propellor spin
This commit is contained in:
parent
f62d2fb183
commit
7fd338f96f
|
@ -176,7 +176,7 @@ spin hn hst = do
|
||||||
updatecmd = mkcmd
|
updatecmd = mkcmd
|
||||||
[ "if [ ! -d " ++ localdir ++ " ]"
|
[ "if [ ! -d " ++ localdir ++ " ]"
|
||||||
, "then (" ++ intercalate " && "
|
, "then (" ++ intercalate " && "
|
||||||
[ "apt-get update"
|
[ "apt-get-fail update"
|
||||||
, "apt-get --no-install-recommends --no-upgrade -y install git make"
|
, "apt-get --no-install-recommends --no-upgrade -y install git make"
|
||||||
, "echo " ++ toMarked statusMarker (show NeedGitClone)
|
, "echo " ++ toMarked statusMarker (show NeedGitClone)
|
||||||
] ++ ") || echo " ++ toMarked statusMarker (show NeedPrecompiled)
|
] ++ ") || echo " ++ toMarked statusMarker (show NeedPrecompiled)
|
||||||
|
|
|
@ -8,7 +8,9 @@ import Data.List
|
||||||
import System.Exit
|
import System.Exit
|
||||||
import System.PosixCompat
|
import System.PosixCompat
|
||||||
import System.Posix.IO
|
import System.Posix.IO
|
||||||
|
import System.Posix.Directory
|
||||||
import Control.Concurrent.Async
|
import Control.Concurrent.Async
|
||||||
|
import Control.Exception (bracket)
|
||||||
import qualified Data.ByteString as B
|
import qualified Data.ByteString as B
|
||||||
|
|
||||||
import Propellor
|
import Propellor
|
||||||
|
@ -131,15 +133,15 @@ sendPrecompiled hn = void $ actionMessage ("Uploading locally compiled propellor
|
||||||
let shimdir = "propellor"
|
let shimdir = "propellor"
|
||||||
let me = localdir </> "propellor"
|
let me = localdir </> "propellor"
|
||||||
void $ Shim.setup me shimdir
|
void $ Shim.setup me shimdir
|
||||||
withTmpFile "propellor.tar" $ \tarball -> allM id
|
withTmpFile "propellor.tar" $ \tarball _ -> allM id
|
||||||
[ boolSystem "strip" [File me]
|
[ boolSystem "strip" [File me]
|
||||||
, boolSystem "tar" [Param "cf", File tmp, File shimdir]
|
, boolSystem "tar" [Param "cf", File tarball, File shimdir]
|
||||||
, boolSystem "scp" $ cacheparams ++ [File tarball, Param ("root@"++hn++":"++remotetarball)
|
, boolSystem "scp" $ cacheparams ++ [File tarball, Param ("root@"++hn++":"++remotetarball)]
|
||||||
, boolSystem "ssh" $ cacheparams ++ [Param ("root@"++hn), Param unpackcmd]
|
, boolSystem "ssh" $ cacheparams ++ [Param ("root@"++hn), Param unpackcmd]
|
||||||
]
|
]
|
||||||
where
|
where
|
||||||
remotetarball = "/usr/local/propellor.tar"
|
remotetarball = "/usr/local/propellor.tar"
|
||||||
unpackcmd = shellSwap $ intercalate " && "
|
unpackcmd = shellWrap $ intercalate " && "
|
||||||
[ "cd " ++ takeDirectory remotetarball
|
[ "cd " ++ takeDirectory remotetarball
|
||||||
, "tar xf " ++ remotetarball
|
, "tar xf " ++ remotetarball
|
||||||
, "rm -f " ++ remotetarball
|
, "rm -f " ++ remotetarball
|
||||||
|
|
Loading…
Reference in New Issue