summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config-joey.hs9
-rw-r--r--src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs33
2 files changed, 28 insertions, 14 deletions
diff --git a/config-joey.hs b/config-joey.hs
index 782c579b..7f32d8b6 100644
--- a/config-joey.hs
+++ b/config-joey.hs
@@ -94,8 +94,8 @@ hosts = -- (o) `
& Docker.configured
& Docker.docked hosts "amd64-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"
+ ! Docker.docked hosts "armel-git-annex-builder-companion"
+ ! Docker.docked hosts "armel-git-annex-builder"
& Docker.garbageCollected `period` Daily
& Apt.buildDep ["git-annex"] `period` Daily
@@ -201,7 +201,8 @@ hosts = -- (o) `
& Docker.volume GitAnnexBuilder.homedir
& File.ownerGroup GitAnnexBuilder.homedir GitAnnexBuilder.builduser GitAnnexBuilder.builduser
-- Install current versions of build deps from cabal.
- & GitAnnexBuilder.treeDeps "armel"
+ & GitAnnexBuilder.tree "armel"
+ & GitAnnexBuilder.buildDepsNoHaskellLibs
& GitAnnexBuilder.cabalDeps
-- The armel builder can ssh to this companion,
-- using $COMPANION_PORT_22_TCP_ADDR as the hostname,
@@ -219,7 +220,7 @@ hosts = -- (o) `
-- (Currently have to run
-- git-annex/standalone/linux/install-haskell-packages
-- which is not fully automated.)
- & GitAnnexBuilder.builder "armel" "1 3 * * *" "5h" True
+ & GitAnnexBuilder.builder' GitAnnexBuilder.buildDepsNoHaskellLibs "armel" "1 3 * * *" "5h" True
] ++ monsters
standardGitAnnexBuilder :: Architecture -> Int -> GitAnnexBuilder.TimeOut -> Host
diff --git a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs
index ddb61381..1dbdbca7 100644
--- a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs
+++ b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs
@@ -21,8 +21,12 @@ builddir = gitbuilderdir </> "build"
type TimeOut = String -- eg, 5h
builder :: Architecture -> CronTimes -> TimeOut -> Bool -> Property
-builder buildarch crontimes timeout rsyncupload = combineProperties "gitannexbuilder"
- [ treeDeps buildarch
+builder = builder' buildDeps
+
+builder' :: Property -> Architecture -> CronTimes -> TimeOut -> Bool -> Property
+builder' buildepsprop buildarch crontimes timeout rsyncupload = combineProperties "gitannexbuilder"
+ [ tree buildarch
+ , buildepsprop
, Apt.serviceInstalledRunning "cron"
, Cron.niceJob "gitannexbuilder" crontimes builduser gitbuilderdir $
"git pull ; timeout " ++ timeout ++ " ./autobuild"
@@ -45,13 +49,10 @@ builder buildarch crontimes timeout rsyncupload = combineProperties "gitannexbui
)
]
-treeDeps :: Architecture -> Property
-treeDeps buildarch = combineProperties "gitannexbuilder"
- [ Apt.stdSourcesList Unstable
- , Apt.buildDep ["git-annex"]
- , Apt.installed ["git", "rsync", "moreutils", "ca-certificates",
- "liblockfile-simple-perl", "cabal-install", "vim", "less"]
- , User.accountFor builduser
+tree :: Architecture -> Property
+tree buildarch = combineProperties "gitannexbuilder tree"
+ [ User.accountFor builduser
+ , Apt.installed ["git"]
, check (not <$> doesDirectoryExist gitbuilderdir) $ userScriptProperty builduser
[ "git clone git://git.kitenet.net/gitannexbuilder " ++ gitbuilderdir
, "cd " ++ gitbuilderdir
@@ -61,9 +62,21 @@ treeDeps buildarch = combineProperties "gitannexbuilder"
, check (not <$> doesDirectoryExist builddir) $ userScriptProperty builduser
[ "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
]
+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
-- does so once.
cabalDeps :: Property
@@ -79,7 +92,7 @@ sshKeyGen = combineProperties "sshkeygen"
, flagFile auth authkeys
]
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]
privkey = homedir </> ".ssh" </> "id_rsa"
pubkey = privkey ++ ".pub"