stable suite changes

* Avoid encoding the current stable suite in propellor's code,
  since that poses a difficult transition around the release,
  and can easily be wrong if an older version of propellor is used.
  Instead, the os property for a stable system includes the suite name
  to use, eg Stable "wheezy".
* stdSourcesList uses the stable suite name, to avoid unwanted
  immediate upgrades to the next stable release.
This commit is contained in:
Joey Hess 2014-10-10 11:27:54 -04:00
parent 1e22e178b4
commit 79ee61d958
6 changed files with 51 additions and 30 deletions

View File

@ -162,7 +162,7 @@ kite = standardSystemUnhardened "kite.kitenet.net" Unstable "amd64"
] ]
diatom :: Host diatom :: Host
diatom = standardSystem "diatom.kitenet.net" Stable "amd64" diatom = standardSystem "diatom.kitenet.net" (Stable "wheezy") "amd64"
[ "Important stuff that needs not too much memory or CPU." ] [ "Important stuff that needs not too much memory or CPU." ]
& ipv4 "107.170.31.195" & ipv4 "107.170.31.195"
@ -282,28 +282,28 @@ elephant = standardSystem "elephant.kitenet.net" Unstable "amd64"
containers :: [Host] containers :: [Host]
containers = containers =
-- Simple web server, publishing the outside host's /var/www -- Simple web server, publishing the outside host's /var/www
[ standardContainer "webserver" Stable "amd64" [ standardStableContainer "webserver"
& Docker.publish "80:80" & Docker.publish "80:80"
& Docker.volume "/var/www:/var/www" & Docker.volume "/var/www:/var/www"
& Apt.serviceInstalledRunning "apache2" & Apt.serviceInstalledRunning "apache2"
-- My own openid provider. Uses php, so containerized for security -- My own openid provider. Uses php, so containerized for security
-- and administrative sanity. -- and administrative sanity.
, standardContainer "openid-provider" Stable "amd64" , standardStableContainer "openid-provider"
& alias "openid.kitenet.net" & alias "openid.kitenet.net"
& Docker.publish "8081:80" & Docker.publish "8081:80"
& OpenId.providerFor ["joey", "liw"] & OpenId.providerFor ["joey", "liw"]
"openid.kitenet.net:8081" "openid.kitenet.net:8081"
-- Exhibit: kite's 90's website. -- Exhibit: kite's 90's website.
, standardContainer "ancient-kitenet" Stable "amd64" , standardStableContainer "ancient-kitenet"
& alias "ancient.kitenet.net" & alias "ancient.kitenet.net"
& Docker.publish "1994:80" & Docker.publish "1994:80"
& Apt.serviceInstalledRunning "apache2" & Apt.serviceInstalledRunning "apache2"
& Git.cloned "root" "git://kitenet-net.branchable.com/" "/var/www" & Git.cloned "root" "git://kitenet-net.branchable.com/" "/var/www"
(Just "remotes/origin/old-kitenet.net") (Just "remotes/origin/old-kitenet.net")
, standardContainer "oldusenet-shellbox" Stable "amd64" , standardStableContainer "oldusenet-shellbox"
& alias "shell.olduse.net" & alias "shell.olduse.net"
& Docker.publish "4200:4200" & Docker.publish "4200:4200"
& JoeySites.oldUseNetShellBox & JoeySites.oldUseNetShellBox
@ -354,6 +354,9 @@ standardSystemUnhardened hn suite arch motd = host hn
& Apt.removed ["exim4", "exim4-daemon-light", "exim4-config", "exim4-base"] & Apt.removed ["exim4", "exim4-daemon-light", "exim4-config", "exim4-base"]
`onChange` Apt.autoRemove `onChange` Apt.autoRemove
standardStableContainer :: Docker.ContainerName -> Host
standardStableContainer name = standardContainer name (Stable "wheezy") "amd64"
-- This is my standard container setup, featuring automatic upgrades. -- This is my standard container setup, featuring automatic upgrades.
standardContainer :: Docker.ContainerName -> DebianSuite -> Architecture -> Host standardContainer :: Docker.ContainerName -> DebianSuite -> Architecture -> Host
standardContainer name suite arch = Docker.container name (dockerImage system) standardContainer name suite arch = Docker.container name (dockerImage system)
@ -370,7 +373,7 @@ standardContainer name suite arch = Docker.container name (dockerImage system)
dockerImage :: System -> Docker.Image dockerImage :: System -> Docker.Image
dockerImage (System (Debian Unstable) arch) = "joeyh/debian-unstable-" ++ arch dockerImage (System (Debian Unstable) arch) = "joeyh/debian-unstable-" ++ arch
dockerImage (System (Debian Testing) arch) = "joeyh/debian-unstable-" ++ arch dockerImage (System (Debian Testing) arch) = "joeyh/debian-unstable-" ++ arch
dockerImage (System (Debian Stable) arch) = "joeyh/debian-stable-" ++ arch dockerImage (System (Debian (Stable _)) arch) = "joeyh/debian-stable-" ++ arch
dockerImage _ = "debian-stable-official" -- does not currently exist! dockerImage _ = "debian-stable-official" -- does not currently exist!
myDnsSecondary :: Property myDnsSecondary :: Property

12
debian/changelog vendored
View File

@ -1,3 +1,15 @@
propellor (0.9.0) UNRELEASED; urgency=medium
* Avoid encoding the current stable suite in propellor's code,
since that poses a difficult transition around the release,
and can easily be wrong if an older version of propellor is used.
Instead, the os property for a stable system includes the suite name
to use, eg Stable "wheezy".
* stdSourcesList uses the stable suite name, to avoid unwanted
immediate upgrades to the next stable release.
-- Joey Hess <joeyh@debian.org> Fri, 10 Oct 2014 11:08:55 -0400
propellor (0.8.3) unstable; urgency=medium propellor (0.8.3) unstable; urgency=medium
* The Debian package now includes a single-revision git repository in * The Debian package now includes a single-revision git repository in

View File

@ -20,14 +20,14 @@ type Section = String
type SourcesGenerator = DebianSuite -> [Line] type SourcesGenerator = DebianSuite -> [Line]
showSuite :: DebianSuite -> String showSuite :: DebianSuite -> String
showSuite Stable = "stable" showSuite (Stable s) = s
showSuite Testing = "testing" showSuite Testing = "testing"
showSuite Unstable = "unstable" showSuite Unstable = "unstable"
showSuite Experimental = "experimental" showSuite Experimental = "experimental"
showSuite (DebianRelease r) = r
backportSuite :: String backportSuite :: DebianSuite -> Maybe String
backportSuite = showSuite stableRelease ++ "-backports" backportSuite (Stable s) = Just (s ++ "-backports")
backportSuite _ = Nothing
debLine :: String -> Url -> [Section] -> Line debLine :: String -> Url -> [Section] -> Line
debLine suite mirror sections = unwords $ debLine suite mirror sections = unwords $
@ -42,12 +42,17 @@ stdSections :: [Section]
stdSections = ["main", "contrib", "non-free"] stdSections = ["main", "contrib", "non-free"]
binandsrc :: String -> SourcesGenerator binandsrc :: String -> SourcesGenerator
binandsrc url suite binandsrc url suite = catMaybes
| isStable suite = [l, srcLine l, bl, srcLine bl] [ Just l
| otherwise = [l, srcLine l] , Just $ srcLine l
, bl
, srcLine <$> bl
]
where where
l = debLine (showSuite suite) url stdSections l = debLine (showSuite suite) url stdSections
bl = debLine backportSuite url stdSections bl = do
bs <- backportSuite suite
return $ debLine bs url stdSections
debCdn :: SourcesGenerator debCdn :: SourcesGenerator
debCdn = binandsrc "http://cdn.debian.net/debian" debCdn = binandsrc "http://cdn.debian.net/debian"
@ -128,13 +133,14 @@ installed' params ps = robustly $ check (isInstallable ps) go
installedBackport :: [Package] -> Property installedBackport :: [Package] -> Property
installedBackport ps = trivial $ withOS desc $ \o -> case o of installedBackport ps = trivial $ withOS desc $ \o -> case o of
Nothing -> error "cannot install backports; os not declared" Nothing -> error "cannot install backports; os not declared"
(Just (System (Debian suite) _)) (Just (System (Debian suite) _)) -> case backportSuite suite of
| isStable suite -> Nothing -> notsupported o
ensureProperty $ runApt $ Just bs -> ensureProperty $ runApt $
["install", "-t", backportSuite, "-y"] ++ ps ["install", "-t", bs, "-y"] ++ ps
_ -> error $ "backports not supported on " ++ show o _ -> notsupported o
where where
desc = (unwords $ "apt installed backport":ps) desc = (unwords $ "apt installed backport":ps)
notsupported o = error $ "backports not supported on " ++ show o
-- | Minimal install of package, without recommends. -- | Minimal install of package, without recommends.
installedMin :: [Package] -> Property installedMin :: [Package] -> Property

View File

@ -105,12 +105,12 @@ installed = Apt.installed ["obnam"]
latestVersion :: Property latestVersion :: Property
latestVersion = withOS "obnam latest version" $ \o -> case o of latestVersion = withOS "obnam latest version" $ \o -> case o of
(Just (System (Debian suite) _)) | isStable suite -> ensureProperty $ (Just (System (Debian suite) _)) | isStable suite -> ensureProperty $
Apt.setSourcesListD stablesources "obnam" Apt.setSourcesListD (stablesources suite) "obnam"
`requires` toProp (Apt.trustsKey key) `requires` toProp (Apt.trustsKey key)
_ -> noChange _ -> noChange
where where
stablesources = stablesources suite =
[ "deb http://code.liw.fi/debian " ++ Apt.showSuite stableRelease ++ " main" [ "deb http://code.liw.fi/debian " ++ Apt.showSuite suite ++ " main"
] ]
-- gpg key used by the code.liw.fi repository. -- gpg key used by the code.liw.fi repository.
key = Apt.AptKey "obnam" $ unlines key = Apt.AptKey "obnam" $ unlines

View File

@ -109,8 +109,8 @@ androidAutoBuilderContainer dockerImage crontimes timeout =
-- Android is cross-built in a Debian i386 container, using the Android NDK. -- Android is cross-built in a Debian i386 container, using the Android NDK.
androidContainer :: (System -> Docker.Image) -> Docker.ContainerName -> Property -> FilePath -> Host androidContainer :: (System -> Docker.Image) -> Docker.ContainerName -> Property -> FilePath -> Host
androidContainer dockerImage name setupgitannexdir gitannexdir = Docker.container name androidContainer dockerImage name setupgitannexdir gitannexdir = Docker.container name
(dockerImage $ System (Debian Stable) "i386") (dockerImage osver)
& os (System (Debian Stable) "i386") & os osver
& Apt.stdSourcesList & Apt.stdSourcesList
& Apt.installed ["systemd"] & Apt.installed ["systemd"]
& User.accountFor builduser & User.accountFor builduser
@ -131,6 +131,7 @@ androidContainer dockerImage name setupgitannexdir gitannexdir = Docker.containe
chrootsetup = scriptProperty chrootsetup = scriptProperty
[ "cd " ++ gitannexdir ++ " && ./standalone/android/buildchroot-inchroot" [ "cd " ++ gitannexdir ++ " && ./standalone/android/buildchroot-inchroot"
] ]
osver = System (Debian (Stable "wheezy")) "i386"
-- armel builder has a companion container using amd64 that -- armel builder has a companion container using amd64 that
-- runs the build first to get TH splices. They need -- runs the build first to get TH splices. They need

View File

@ -13,15 +13,14 @@ data Distribution
| Ubuntu Release | Ubuntu Release
deriving (Show, Eq) deriving (Show, Eq)
data DebianSuite = Experimental | Unstable | Testing | Stable | DebianRelease Release -- | Debian has several rolling suites, and a number of stable releases,
-- such as Stable "wheezy".
data DebianSuite = Experimental | Unstable | Testing | Stable Release
deriving (Show, Eq) deriving (Show, Eq)
-- | The release that currently corresponds to stable.
stableRelease :: DebianSuite
stableRelease = DebianRelease "wheezy"
isStable :: DebianSuite -> Bool isStable :: DebianSuite -> Bool
isStable s = s == Stable || s == stableRelease isStable (Stable _) = True
isStable _ = False
type Release = String type Release = String
type Architecture = String type Architecture = String