propellor spin

This commit is contained in:
Joey Hess 2014-05-20 18:28:13 -04:00
parent 7eeb58dab9
commit 9acd70eb4c
Failed to extract signature
2 changed files with 28 additions and 14 deletions

View File

@ -94,8 +94,8 @@ hosts = -- (o) `
& Docker.configured & Docker.configured
& Docker.docked hosts "amd64-git-annex-builder" & Docker.docked hosts "amd64-git-annex-builder"
& Docker.docked hosts "i386-git-annex-builder" & Docker.docked hosts "i386-git-annex-builder"
& Docker.docked hosts "armel-git-annex-builder-companion" ! Docker.docked hosts "armel-git-annex-builder-companion"
& Docker.docked hosts "armel-git-annex-builder" ! Docker.docked hosts "armel-git-annex-builder"
& Docker.garbageCollected `period` Daily & Docker.garbageCollected `period` Daily
& Apt.buildDep ["git-annex"] `period` Daily & Apt.buildDep ["git-annex"] `period` Daily
@ -201,7 +201,8 @@ hosts = -- (o) `
& Docker.volume GitAnnexBuilder.homedir & Docker.volume GitAnnexBuilder.homedir
& File.ownerGroup GitAnnexBuilder.homedir GitAnnexBuilder.builduser GitAnnexBuilder.builduser & File.ownerGroup GitAnnexBuilder.homedir GitAnnexBuilder.builduser GitAnnexBuilder.builduser
-- Install current versions of build deps from cabal. -- Install current versions of build deps from cabal.
& GitAnnexBuilder.treeDeps "armel" & GitAnnexBuilder.tree "armel"
& GitAnnexBuilder.buildDepsNoHaskellLibs
& GitAnnexBuilder.cabalDeps & GitAnnexBuilder.cabalDeps
-- The armel builder can ssh to this companion, -- The armel builder can ssh to this companion,
-- using $COMPANION_PORT_22_TCP_ADDR as the hostname, -- using $COMPANION_PORT_22_TCP_ADDR as the hostname,
@ -219,7 +220,7 @@ hosts = -- (o) `
-- (Currently have to run -- (Currently have to run
-- git-annex/standalone/linux/install-haskell-packages -- git-annex/standalone/linux/install-haskell-packages
-- which is not fully automated.) -- which is not fully automated.)
& GitAnnexBuilder.builder "armel" "1 3 * * *" "5h" True & GitAnnexBuilder.builder' GitAnnexBuilder.buildDepsNoHaskellLibs "armel" "1 3 * * *" "5h" True
] ++ monsters ] ++ monsters
standardGitAnnexBuilder :: Architecture -> Int -> GitAnnexBuilder.TimeOut -> Host standardGitAnnexBuilder :: Architecture -> Int -> GitAnnexBuilder.TimeOut -> Host

View File

@ -21,8 +21,12 @@ builddir = gitbuilderdir </> "build"
type TimeOut = String -- eg, 5h type TimeOut = String -- eg, 5h
builder :: Architecture -> CronTimes -> TimeOut -> Bool -> Property builder :: Architecture -> CronTimes -> TimeOut -> Bool -> Property
builder buildarch crontimes timeout rsyncupload = combineProperties "gitannexbuilder" builder = builder' buildDeps
[ treeDeps buildarch
builder' :: Property -> Architecture -> CronTimes -> TimeOut -> Bool -> Property
builder' buildepsprop buildarch crontimes timeout rsyncupload = combineProperties "gitannexbuilder"
[ tree buildarch
, buildepsprop
, Apt.serviceInstalledRunning "cron" , Apt.serviceInstalledRunning "cron"
, Cron.niceJob "gitannexbuilder" crontimes builduser gitbuilderdir $ , Cron.niceJob "gitannexbuilder" crontimes builduser gitbuilderdir $
"git pull ; timeout " ++ timeout ++ " ./autobuild" "git pull ; timeout " ++ timeout ++ " ./autobuild"
@ -45,13 +49,10 @@ builder buildarch crontimes timeout rsyncupload = combineProperties "gitannexbui
) )
] ]
treeDeps :: Architecture -> Property tree :: Architecture -> Property
treeDeps buildarch = combineProperties "gitannexbuilder" tree buildarch = combineProperties "gitannexbuilder tree"
[ Apt.stdSourcesList Unstable [ User.accountFor builduser
, Apt.buildDep ["git-annex"] , Apt.installed ["git"]
, Apt.installed ["git", "rsync", "moreutils", "ca-certificates",
"liblockfile-simple-perl", "cabal-install", "vim", "less"]
, User.accountFor builduser
, check (not <$> doesDirectoryExist gitbuilderdir) $ userScriptProperty builduser , check (not <$> doesDirectoryExist gitbuilderdir) $ userScriptProperty builduser
[ "git clone git://git.kitenet.net/gitannexbuilder " ++ gitbuilderdir [ "git clone git://git.kitenet.net/gitannexbuilder " ++ gitbuilderdir
, "cd " ++ gitbuilderdir , "cd " ++ gitbuilderdir
@ -61,9 +62,21 @@ treeDeps buildarch = combineProperties "gitannexbuilder"
, check (not <$> doesDirectoryExist builddir) $ userScriptProperty builduser , check (not <$> doesDirectoryExist builddir) $ userScriptProperty builduser
[ "git clone git://git-annex.branchable.com/ " ++ builddir [ "git clone git://git-annex.branchable.com/ " ++ builddir
] ]
]
buildDeps :: Property
buildDeps = combineProperties "gitannexbuilder build deps"
[ Apt.stdSourcesList Unstable
, Apt.buildDep ["git-annex"]
, buildDepsNoHaskellLibs
, "git-annex source build deps installed" ==> Apt.buildDepIn builddir , "git-annex source build deps installed" ==> Apt.buildDepIn builddir
] ]
buildDepsNoHaskellLibs :: Property
buildDepsNoHaskellLibs = Apt.installed ["git", "rsync", "moreutils", "ca-certificates",
"debhelper", "ghc", "curl", "openssh-client", "git-remote-gcrypt",
"liblockfile-simple-perl", "cabal-install", "vim", "less"]
-- Installs current versions of git-annex's deps from cabal, but only -- Installs current versions of git-annex's deps from cabal, but only
-- does so once. -- does so once.
cabalDeps :: Property cabalDeps :: Property
@ -79,7 +92,7 @@ sshKeyGen = combineProperties "sshkeygen"
, flagFile auth authkeys , flagFile auth authkeys
] ]
where where
gen = userScriptProperty builduser ["ssh-keygen -t RSA -N '' -f " ++ f] gen = userScriptProperty builduser ["ssh-keygen -t RSA -N '' -f " ++ privkey]
auth = userScriptProperty builduser ["cp " ++ pubkey ++ " " ++ authkeys] auth = userScriptProperty builduser ["cp " ++ pubkey ++ " " ++ authkeys]
privkey = homedir </> ".ssh" </> "id_rsa" privkey = homedir </> ".ssh" </> "id_rsa"
pubkey = privkey ++ ".pub" pubkey = privkey ++ ".pub"