propellor spin

This commit is contained in:
Joey Hess 2014-04-10 11:02:29 -04:00
parent 7a0074454b
commit 222e2fe8a4
Failed to extract signature
3 changed files with 20 additions and 2 deletions

View File

@ -3,6 +3,7 @@ module Propellor.Property where
import System.Directory import System.Directory
import Control.Monad import Control.Monad
import Data.Monoid import Data.Monoid
import Control.Monad.IfElse
import Propellor.Types import Propellor.Types
import Propellor.Engine import Propellor.Engine
@ -54,7 +55,8 @@ flagFile property flagfile = Property (propertyDesc property) $
go False = do go False = do
r <- ensureProperty property r <- ensureProperty property
when (r == MadeChange) $ when (r == MadeChange) $
writeFile flagfile "" unlessM (doesFileExist flagfile) $
writeFile flagfile ""
return r return r
--- | Whenever a change has to be made for a Property, causes a hook --- | Whenever a change has to be made for a Property, causes a hook

View File

@ -21,7 +21,6 @@ import qualified Data.Map as M
period :: Property -> Recurrance -> Property period :: Property -> Recurrance -> Property
period prop recurrance = Property desc $ do period prop recurrance = Property desc $ do
lasttime <- getLastChecked (propertyDesc prop) lasttime <- getLastChecked (propertyDesc prop)
print lasttime
nexttime <- fmap startTime <$> nextTime schedule lasttime nexttime <- fmap startTime <$> nextTime schedule lasttime
t <- localNow t <- localNow
if Just t >= nexttime if Just t >= nexttime

View File

@ -42,6 +42,7 @@ host hostname@"clam.kitenet.net" = Just $ withSystemd $ props
& JoeySites.oldUseNetshellBox & JoeySites.oldUseNetshellBox
& Docker.docked container hostname "openid-provider" & Docker.docked container hostname "openid-provider"
`requires` Apt.installed ["ntp"] `requires` Apt.installed ["ntp"]
& Docker.docked container hostname "ancient.kitenet.net"
& Docker.configured & Docker.configured
& Docker.garbageCollected `period` Daily & Docker.garbageCollected `period` Daily
-- Orca is the main git-annex build box. -- Orca is the main git-annex build box.
@ -69,6 +70,9 @@ host hostname@"diatom.kitenet.net" = Just $ props
& Git.daemonRunning "/srv/git" & Git.daemonRunning "/srv/git"
& File.ownerGroup "/srv/git" "joey" "joey" & File.ownerGroup "/srv/git" "joey" "joey"
-- git repos restore (how?) -- git repos restore (how?)
-- family annex needs family members to have accounts,
-- ssh host key etc.. finesse?
-- (also should upgrade git-annex-shell for it..)
-- kgb installation and setup -- kgb installation and setup
-- ssh keys for branchable and github repo hooks -- ssh keys for branchable and github repo hooks
-- gitweb -- gitweb
@ -103,6 +107,19 @@ container _parenthost name
"openid.kitenet.net:8081" "openid.kitenet.net:8081"
] ]
| name == "ancient.kitenet.net" = Just $ standardContainer Stable "amd64"
[ Docker.publish "1994:80"
, Docker.inside $ props
& Apt.serviceInstalledRunning "apache2"
& Apt.installed ["git"]
& scriptProperty
[ "cd /var/"
, "rm -rf www"
, "git clone git://git.kitenet.net/git/kitewiki www"
, "git checkout remotes/origin/old-kitenet.net"
] `flagFile` "/var/www/blastfromthepast.html"
]
-- armel builder has a companion container that run amd64 and -- armel builder has a companion container that run amd64 and
-- runs the build first to get TH splices. They share a home -- runs the build first to get TH splices. They share a home
-- directory, and need to have the same versions of all haskell -- directory, and need to have the same versions of all haskell