summaryrefslogtreecommitdiff
path: root/src/Propellor
diff options
context:
space:
mode:
authorJoey Hess2014-05-21 12:58:53 -0400
committerJoey Hess2014-05-21 12:58:53 -0400
commit7ac991635c0dbdb2ace19480fcac22dae36e5409 (patch)
treecb414b74431f517ee18eaa63e5f727a5e7c52399 /src/Propellor
parenteeb2d688bdf435158929bb3cbfea6fb68076de9e (diff)
propellor spin
Diffstat (limited to 'src/Propellor')
-rw-r--r--src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs32
1 files changed, 11 insertions, 21 deletions
diff --git a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs
index 428b3d00..acf122af 100644
--- a/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs
+++ b/src/Propellor/Property/SiteSpecific/GitAnnexBuilder.hs
@@ -53,15 +53,18 @@ builder' buildepsprop buildarch crontimes timeout rsyncupload = combinePropertie
tree :: Architecture -> Property
tree buildarch = combineProperties "gitannexbuilder tree"
[ User.accountFor builduser
- -- Home directory already exists when docker volume is used.
- , File.ownerGroup homedir builduser builduser
, Apt.installed ["git"]
- , check (not <$> doesDirectoryExist gitbuilderdir) $ userScriptProperty builduser
- [ "git clone git://git.kitenet.net/gitannexbuilder " ++ gitbuilderdir
- , "cd " ++ gitbuilderdir
- , "git checkout " ++ buildarch
- ]
- `describe` "gitbuilder setup"
+ -- gitbuilderdir directory already exists when docker volume is used,
+ -- but with wrong owner.
+ , File.dirExists gitbuilderdir
+ , File.ownerGroup gitbuilderdir builduser builduser
+ , check (not <$> (doesDirectoryExist (gitbuilderdir </> ".git"))) $
+ userScriptProperty builduser
+ [ "git clone git://git.kitenet.net/gitannexbuilder " ++ gitbuilderdir
+ , "cd " ++ gitbuilderdir
+ , "git checkout " ++ buildarch
+ ]
+ `describe` "gitbuilder setup"
, check (not <$> doesDirectoryExist builddir) $ userScriptProperty builduser
[ "git clone git://git-annex.branchable.com/ " ++ builddir
]
@@ -90,16 +93,3 @@ cabalDeps = flagFile go cabalupdated
where
go = userScriptProperty builduser ["cabal update && cabal install git-annex --only-dependencies || true"]
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"