Merge lp:~vorlon/ubuntu-cdimage/ubuntu-core-channels into lp:ubuntu-cdimage

Proposed by Steve Langasek
Status: Merged
Merged at revision: 1705
Proposed branch: lp:~vorlon/ubuntu-cdimage/ubuntu-core-channels
Merge into: lp:ubuntu-cdimage
Diff against target: 61 lines (+17/-1)
4 files modified
lib/cdimage/config.py (+1/-0)
lib/cdimage/livefs.py (+8/-0)
lib/cdimage/tests/test_tree.py (+6/-0)
lib/cdimage/tree.py (+2/-1)
To merge this branch: bzr merge lp:~vorlon/ubuntu-cdimage/ubuntu-core-channels
Reviewer Review Type Date Requested Status
Ubuntu CD Image Team Pending
Review via email: mp+336070@code.launchpad.net

Description of the change

Support has landed in launchpad-buildd and livecd-rootfs (in bionic-proposed) for building ubuntu-core images from a different snap channel than the default of 'edge'. This is the last piece to let us leverage that for automatic builds of images for multiple channels, using a single livefs definition.

To post a comment you must log in.
1705. By Steve Langasek

Explicit test that we construct the correct publication path when using a non-default channel

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/cdimage/config.py'
2--- lib/cdimage/config.py 2017-11-08 22:52:38 +0000
3+++ lib/cdimage/config.py 2018-01-16 03:16:21 +0000
4@@ -256,6 +256,7 @@
5 "UBUNTU_DEFAULTS_LOCALE",
6 "SSH_ORIGINAL_COMMAND",
7 "EXTRA_PPAS",
8+ "CHANNEL",
9 )
10
11
12
13=== modified file 'lib/cdimage/livefs.py'
14--- lib/cdimage/livefs.py 2017-11-16 17:29:08 +0000
15+++ lib/cdimage/livefs.py 2018-01-16 03:16:21 +0000
16@@ -229,6 +229,14 @@
17 if config["EXTRA_PPAS"]:
18 metadata_override["extra_ppas"] = config["EXTRA_PPAS"].split()
19
20+ if config["CHANNEL"]:
21+ try:
22+ kwargs["unique_key"] += "_" + config["CHANNEL"]
23+ except KeyError:
24+ kwargs["unique_key"] = config["CHANNEL"]
25+
26+ metadata_override["channel"] = config["CHANNEL"]
27+
28 if metadata_override:
29 kwargs["metadata_override"] = metadata_override
30
31
32=== modified file 'lib/cdimage/tests/test_tree.py'
33--- lib/cdimage/tests/test_tree.py 2017-11-08 04:57:34 +0000
34+++ lib/cdimage/tests/test_tree.py 2018-01-16 03:16:21 +0000
35@@ -696,6 +696,12 @@
36 self.config.root, "www", "full", "ubuntu-core",
37 self.config.core_series, "edge"),
38 self.make_publisher("ubuntu-core", "daily-live").publish_base)
39+ self.config["CHANNEL"] = 'stable'
40+ self.assertEqual(
41+ os.path.join(
42+ self.config.root, "www", "full", "ubuntu-core",
43+ self.config.core_series, "stable"),
44+ self.make_publisher("ubuntu-core", "daily-live").publish_base)
45 self.assertEqual(
46 os.path.join(
47 self.config.root, "www", "full", "kubuntu", "daily-live"),
48
49=== modified file 'lib/cdimage/tree.py'
50--- lib/cdimage/tree.py 2017-11-13 16:16:42 +0000
51+++ lib/cdimage/tree.py 2018-01-16 03:16:21 +0000
52@@ -1709,7 +1709,8 @@
53 def image_type_dir(self):
54 if (self.config.project == "ubuntu-core" and
55 self.image_type == 'daily-live'):
56- return os.path.join(self.config.core_series, 'edge')
57+ channel = self.config.get("CHANNEL", "edge")
58+ return os.path.join(self.config.core_series, channel)
59 image_type_dir = self.image_type.replace("_", "/")
60 if (self.config.distribution != "ubuntu" or
61 not self.config["DIST"].is_latest):

Subscribers

People subscribed via source and target branches