Repository: OddBloke/ubuntu-standalone-builder

Issue:
Set a serial in /etc/cloud/build.info in built images
This should make it clear that they are custom-built images.

Discussion:

Patch:
diff --git a/generate_build_config.py b/generate_build_config.py
index 3fcfe42..09a71fe 100755
--- a/generate_build_config.py
+++ b/generate_build_config.py
@@ -30,7 +30,7 @@ runcmd:
 - {homedir}/launchpad-buildd/mount-chroot $BUILD_ID
 - {homedir}/launchpad-buildd/update-debian-chroot $BUILD_ID
 {ppa_conf}
-- {homedir}/launchpad-buildd/buildlivefs --arch amd64 --project ubuntu-cpc --series xenial --build-id $BUILD_ID
+- {homedir}/launchpad-buildd/buildlivefs --arch amd64 --project ubuntu-cpc --series xenial --build-id $BUILD_ID --datestamp ubuntu-standalone-builder-$(date +%s)
 - {homedir}/launchpad-buildd/umount-chroot $BUILD_ID
 - mkdir {homedir}/images
 - mv $CHROOT_ROOT/build/livecd.ubuntu-cpc.* {homedir}/images


Test patch:
diff --git a/tests.py b/tests.py
index 5f83236..1b55bfa 100644
--- a/tests.py
+++ b/tests.py
@@ -65,6 +65,13 @@ class TestWriteCloudConfig(object):
         assert '- export BUILD_ID=output' in \
             write_cloud_config_in_memory().splitlines()
 
+    def test_serial_includes_ubuntu_standalone_builder(
+            self, write_cloud_config_in_memory):
+        buildlivefs_line = [
+            line for line in write_cloud_config_in_memory().splitlines()
+            if 'buildlivefs' in line][0]
+        assert '--datestamp ubuntu-standalone-builder' in buildlivefs_line
+
     def test_write_files_not_included_by_default(
             self, write_cloud_config_in_memory):
         cloud_config = yaml.load(write_cloud_config_in_memory())