changed Arch to String type
This commit is contained in:
parent
a200bcd85a
commit
3fae22e95b
|
@ -6,8 +6,6 @@ import qualified Propellor.Property.User as User
|
||||||
import qualified Propellor.Property.Cron as Cron
|
import qualified Propellor.Property.Cron as Cron
|
||||||
import Propellor.Property.Cron (CronTimes)
|
import Propellor.Property.Cron (CronTimes)
|
||||||
|
|
||||||
import Data.Char
|
|
||||||
|
|
||||||
builduser :: UserName
|
builduser :: UserName
|
||||||
builduser = "builder"
|
builduser = "builder"
|
||||||
|
|
||||||
|
@ -26,7 +24,7 @@ builder arch crontimes = combineProperties "gitannexbuilder"
|
||||||
, check (lacksdir builddir) $ userScriptProperty builduser
|
, check (lacksdir builddir) $ userScriptProperty builduser
|
||||||
[ "git clone git://git.kitenet.net/gitannexbuilder " ++ builddir
|
[ "git clone git://git.kitenet.net/gitannexbuilder " ++ builddir
|
||||||
, "cd " ++ builddir
|
, "cd " ++ builddir
|
||||||
, "git checkout " ++ map toLower (show arch)
|
, "git checkout " ++ arch
|
||||||
]
|
]
|
||||||
`describe` "gitbuilder setup"
|
`describe` "gitbuilder setup"
|
||||||
, check (lacksdir $ builddir </> "build") $ userScriptProperty builduser
|
, check (lacksdir $ builddir </> "build") $ userScriptProperty builduser
|
||||||
|
|
|
@ -40,8 +40,7 @@ data DebianSuite = Experimental | Unstable | Testing | Stable | DebianRelease Re
|
||||||
|
|
||||||
type Release = String
|
type Release = String
|
||||||
|
|
||||||
data Architecture = Amd64 | I386 | Armel
|
type Architecture = String
|
||||||
deriving (Show)
|
|
||||||
|
|
||||||
-- | Results of actions, with color.
|
-- | Results of actions, with color.
|
||||||
class ActionResult a where
|
class ActionResult a where
|
||||||
|
|
38
config.hs
38
config.hs
|
@ -20,6 +20,7 @@ import qualified Propellor.Property.Docker as Docker
|
||||||
import qualified Propellor.Property.SiteSpecific.GitHome as GitHome
|
import qualified Propellor.Property.SiteSpecific.GitHome as GitHome
|
||||||
import qualified Propellor.Property.SiteSpecific.GitAnnexBuilder as GitAnnexBuilder
|
import qualified Propellor.Property.SiteSpecific.GitAnnexBuilder as GitAnnexBuilder
|
||||||
import qualified Propellor.Property.SiteSpecific.JoeySites as JoeySites
|
import qualified Propellor.Property.SiteSpecific.JoeySites as JoeySites
|
||||||
|
import Data.List
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = defaultMain [host, Docker.containerProperties container]
|
main = defaultMain [host, Docker.containerProperties container]
|
||||||
|
@ -48,10 +49,12 @@ host hostname@"clam.kitenet.net" = Just
|
||||||
, Apt.installed ["systemd-sysv"] `onChange` Reboot.now
|
, Apt.installed ["systemd-sysv"] `onChange` Reboot.now
|
||||||
]
|
]
|
||||||
host hostname@"orca.kitenet.net" = Just
|
host hostname@"orca.kitenet.net" = Just
|
||||||
[ standardSystem Unstable
|
[ Hostname.set hostname
|
||||||
|
, standardSystem Unstable
|
||||||
, Apt.unattendedUpgrades True
|
, Apt.unattendedUpgrades True
|
||||||
, Docker.configured
|
, Docker.configured
|
||||||
, Docker.docked container hostname "git-annex-amd64-builder"
|
, Docker.docked container hostname "amd64-git-annex-builder"
|
||||||
|
, Docker.docked container hostname "i386-git-annex-builder"
|
||||||
, Docker.garbageCollected
|
, Docker.garbageCollected
|
||||||
]
|
]
|
||||||
-- add more hosts here...
|
-- add more hosts here...
|
||||||
|
@ -61,26 +64,29 @@ host _ = Nothing
|
||||||
-- | This is where Docker containers are set up. A container
|
-- | This is where Docker containers are set up. A container
|
||||||
-- can vary by hostname where it's used, or be the same everywhere.
|
-- can vary by hostname where it's used, or be the same everywhere.
|
||||||
container :: HostName -> Docker.ContainerName -> Maybe (Docker.Container)
|
container :: HostName -> Docker.ContainerName -> Maybe (Docker.Container)
|
||||||
container _ "webserver" = Just $ Docker.containerFrom
|
container _host name
|
||||||
(image $ System (Debian Unstable) Amd64)
|
| name == "webserver" = Just $ Docker.containerFrom
|
||||||
[ Docker.publish "8080:80"
|
(image $ System (Debian Unstable) "amd64")
|
||||||
, Docker.volume "/var/www:/var/www"
|
[ Docker.publish "8080:80"
|
||||||
, Docker.inside
|
, Docker.volume "/var/www:/var/www"
|
||||||
[ serviceRunning "apache2"
|
, Docker.inside
|
||||||
`requires` Apt.installed ["apache2"]
|
[ serviceRunning "apache2"
|
||||||
|
`requires` Apt.installed ["apache2"]
|
||||||
|
]
|
||||||
]
|
]
|
||||||
]
|
| "-git-annex-builder" `isSuffixOf` name =
|
||||||
container _ "git-annex-amd64-builder" = Just $ Docker.containerFrom
|
let arch = takeWhile (/= '-') name
|
||||||
(image $ System (Debian Unstable) Amd64)
|
in Just $ Docker.containerFrom
|
||||||
[ Docker.inside [ GitAnnexBuilder.builder Amd64 "15 * * * *" ] ]
|
(image $ System (Debian Unstable) arch)
|
||||||
container _ _ = Nothing
|
[ Docker.inside [ GitAnnexBuilder.builder arch "15 * * * *" ] ]
|
||||||
|
| otherwise = Nothing
|
||||||
|
|
||||||
-- | Docker images I prefer to use.
|
-- | Docker images I prefer to use.
|
||||||
-- Edit as suites you, or delete this function and just put the image names
|
-- Edit as suites you, or delete this function and just put the image names
|
||||||
-- above.
|
-- above.
|
||||||
image :: System -> Docker.Image
|
image :: System -> Docker.Image
|
||||||
image (System (Debian Unstable) Amd64) = "joeyh/debian-unstable"
|
image (System (Debian Unstable) "amd64") = "joeyh/debian-unstable"
|
||||||
image (System (Debian Unstable) I386) = "joeyh/debian-i386"
|
image (System (Debian Unstable) "i386") = "joeyh/debian-unstable-i386"
|
||||||
image _ = "debian"
|
image _ = "debian"
|
||||||
|
|
||||||
-- This is my standard system setup
|
-- This is my standard system setup
|
||||||
|
|
|
@ -44,7 +44,7 @@ host _ = Nothing
|
||||||
-- can vary by hostname where it's used, or be the same everywhere.
|
-- can vary by hostname where it's used, or be the same everywhere.
|
||||||
container :: HostName -> Docker.ContainerName -> Maybe (Docker.Container)
|
container :: HostName -> Docker.ContainerName -> Maybe (Docker.Container)
|
||||||
container _ "webserver" = Just $ Docker.containerFrom "joeyh/debian-unstable"
|
container _ "webserver" = Just $ Docker.containerFrom "joeyh/debian-unstable"
|
||||||
(image $ System (Debian Unstable) Amd64)
|
(image $ System (Debian Unstable) "amd64")
|
||||||
[ Docker.publish "80:80"
|
[ Docker.publish "80:80"
|
||||||
, Docker.volume "/var/www:/var/www"
|
, Docker.volume "/var/www:/var/www"
|
||||||
, Docker.inside
|
, Docker.inside
|
||||||
|
|
Loading…
Reference in New Issue