propellor spin
This commit is contained in:
parent
eeb2d688bd
commit
7ac991635c
|
@ -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
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@ hosts = -- (o) `
|
||||||
& Apt.stdSourcesList Unstable
|
& Apt.stdSourcesList Unstable
|
||||||
& Apt.unattendedUpgrades
|
& Apt.unattendedUpgrades
|
||||||
-- This volume is shared with the armel builder.
|
-- This volume is shared with the armel builder.
|
||||||
& Docker.volume GitAnnexBuilder.homedir
|
& Docker.volume GitAnnexBuilder.gitbuilderdir
|
||||||
-- Install current versions of build deps from cabal.
|
-- Install current versions of build deps from cabal.
|
||||||
& GitAnnexBuilder.tree "armel"
|
& GitAnnexBuilder.tree "armel"
|
||||||
& GitAnnexBuilder.buildDepsNoHaskellLibs
|
& GitAnnexBuilder.buildDepsNoHaskellLibs
|
||||||
|
@ -208,8 +208,7 @@ hosts = -- (o) `
|
||||||
-- using $COMPANION_PORT_22_TCP_ADDR as the hostname,
|
-- using $COMPANION_PORT_22_TCP_ADDR as the hostname,
|
||||||
& Docker.expose "22"
|
& Docker.expose "22"
|
||||||
& Apt.serviceInstalledRunning "ssh"
|
& Apt.serviceInstalledRunning "ssh"
|
||||||
-- ssh key is shared via the home directory volume
|
& Ssh.authorizedKeys GitAnnexBuilder.builduser
|
||||||
& GitAnnexBuilder.sshKeyGen
|
|
||||||
, Docker.container "armel-git-annex-builder"
|
, Docker.container "armel-git-annex-builder"
|
||||||
(image $ System (Debian Unstable) "armel")
|
(image $ System (Debian Unstable) "armel")
|
||||||
& Apt.stdSourcesList Unstable
|
& Apt.stdSourcesList Unstable
|
||||||
|
@ -217,6 +216,7 @@ hosts = -- (o) `
|
||||||
& Apt.installed ["openssh-client"]
|
& Apt.installed ["openssh-client"]
|
||||||
& Docker.link "armel-git-annex-builder-companion" "companion"
|
& Docker.link "armel-git-annex-builder-companion" "companion"
|
||||||
& Docker.volumes_from "armel-git-annex-builder-companion"
|
& Docker.volumes_from "armel-git-annex-builder-companion"
|
||||||
|
& Ssh.keyImported SshRsa GitAnnexBuilder.builduser
|
||||||
-- TODO: automate installing haskell libs
|
-- TODO: automate installing haskell libs
|
||||||
-- (Currently have to run
|
-- (Currently have to run
|
||||||
-- git-annex/standalone/linux/install-haskell-packages
|
-- git-annex/standalone/linux/install-haskell-packages
|
||||||
|
|
|
@ -53,15 +53,18 @@ builder' buildepsprop buildarch crontimes timeout rsyncupload = combinePropertie
|
||||||
tree :: Architecture -> Property
|
tree :: Architecture -> Property
|
||||||
tree buildarch = combineProperties "gitannexbuilder tree"
|
tree buildarch = combineProperties "gitannexbuilder tree"
|
||||||
[ User.accountFor builduser
|
[ User.accountFor builduser
|
||||||
-- Home directory already exists when docker volume is used.
|
|
||||||
, File.ownerGroup homedir builduser builduser
|
|
||||||
, Apt.installed ["git"]
|
, Apt.installed ["git"]
|
||||||
, check (not <$> doesDirectoryExist gitbuilderdir) $ userScriptProperty builduser
|
-- gitbuilderdir directory already exists when docker volume is used,
|
||||||
[ "git clone git://git.kitenet.net/gitannexbuilder " ++ gitbuilderdir
|
-- but with wrong owner.
|
||||||
, "cd " ++ gitbuilderdir
|
, File.dirExists gitbuilderdir
|
||||||
, "git checkout " ++ buildarch
|
, File.ownerGroup gitbuilderdir builduser builduser
|
||||||
]
|
, check (not <$> (doesDirectoryExist (gitbuilderdir </> ".git"))) $
|
||||||
`describe` "gitbuilder setup"
|
userScriptProperty builduser
|
||||||
|
[ "git clone git://git.kitenet.net/gitannexbuilder " ++ gitbuilderdir
|
||||||
|
, "cd " ++ gitbuilderdir
|
||||||
|
, "git checkout " ++ buildarch
|
||||||
|
]
|
||||||
|
`describe` "gitbuilder setup"
|
||||||
, 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
|
||||||
]
|
]
|
||||||
|
@ -90,16 +93,3 @@ cabalDeps = flagFile go cabalupdated
|
||||||
where
|
where
|
||||||
go = userScriptProperty builduser ["cabal update && cabal install git-annex --only-dependencies || true"]
|
go = userScriptProperty builduser ["cabal update && cabal install git-annex --only-dependencies || true"]
|
||||||
cabalupdated = homedir </> ".cabal" </> "packages" </> "hackage.haskell.org" </> "00-index.cache"
|
cabalupdated = homedir </> ".cabal" </> "packages" </> "hackage.haskell.org" </> "00-index.cache"
|
||||||
|
|
||||||
-- Ensure a ssh key is set up, and allow it to be used to ssh in
|
|
||||||
sshKeyGen :: Property
|
|
||||||
sshKeyGen = combineProperties "sshkeygen"
|
|
||||||
[ flagFile gen privkey
|
|
||||||
, flagFile auth authkeys
|
|
||||||
]
|
|
||||||
where
|
|
||||||
gen = userScriptProperty builduser ["ssh-keygen -t RSA -N '' -f " ++ privkey]
|
|
||||||
auth = userScriptProperty builduser ["cp " ++ pubkey ++ " " ++ authkeys]
|
|
||||||
privkey = homedir </> ".ssh" </> "id_rsa"
|
|
||||||
pubkey = privkey ++ ".pub"
|
|
||||||
authkeys = homedir </> ".ssh" </> "authorized_keys"
|
|
||||||
|
|
Loading…
Reference in New Issue