@cryptotaxi247 / netdata-1 / commits / 82ad790da

netdata/packaging: fix changelog generation failing the build (#6778)

We bumped into an error that caused debian/jessie package generation to fail. When building stable release, we don't properly detect the change from previous stable to this one. So the changelog generation fails and only on some distros causes the process to fail. With this change we attempt to detect this peculiarity and just try fo decrease latest release version, to properly fetch the full changes

Paul Emm. Katsoulakis committed Sep 5, 2019 at 10:27 UTC 82ad790da7d59f6bf317009c580c07fe09e53e3d
1 file changed +11 -3
.travis/package_management/trigger_deb_lxc_build.py
+11 -3
@@ -53,18 +53,26 @@ unpacked_netdata = netdata_tarball.replace(".tar.gz", "")
53 print("Extracting tarball %s" % netdata_tarball)
54 common.run_command(container, ["sudo", "-u", os.environ['BUILDER_NAME'], "tar", "xf", netdata_tarball, "-C", build_path])
55
56 +print("Checking version consistency")
57 +since_version = os.environ["LATEST_RELEASE_VERSION"]
58 +if str(since_version).replace('v', '') == str(new_version) and str(new_version).count('.') == 2:
59 + s = since_version.split('.')
60 + prev = str(int(s[1]) - 1)
61 + since_version = s[0] + '.' + prev + s[2]
62 + print("We seem to be building a new stable release, reduce by one since_version option. New since_version:%s" % since_version)
63 +
64 print("Fixing changelog tags")
65 changelog_in_host = "contrib/debian/changelog"
58 -common.run_command_in_host(['sed', '-i', 's/PREVIOUS_PACKAGE_VERSION/%s-1/g' % os.environ["LATEST_RELEASE_VERSION"].replace("v", ""), changelog_in_host])
66 +common.run_command_in_host(['sed', '-i', 's/PREVIOUS_PACKAGE_VERSION/%s-1/g' % since_version.replace("v", ""), changelog_in_host])
67 common.run_command_in_host(['sed', '-i', 's/PREVIOUS_PACKAGE_DATE/%s/g' % os.environ["LATEST_RELEASE_DATE"], changelog_in_host])
68
69 print("Executing gbp dch command..")
62 -common.run_command_in_host(['gbp', 'dch', '--release', '--ignore-branch', '--spawn-editor=snapshot', '--since=%s' % os.environ["LATEST_RELEASE_VERSION"], '--new-version=%s' % new_version])
70 +common.run_command_in_host(['gbp', 'dch', '--release', '--ignore-branch', '--spawn-editor=snapshot', '--since=%s' % since_version, '--new-version=%s' % new_version])
71
72 print("Copying over changelog to the destination machine")
73 common.run_command_in_host(['sudo', 'cp', 'debian/changelog', "%s/%s/netdata-%s/contrib/debian/" % (os.environ['LXC_CONTAINER_ROOT'], build_path, new_version)])
74
67 -print("Running debian build script since %s" % os.environ["LATEST_RELEASE_VERSION"])
75 +print("Running debian build script since %s" % since_version)
76 common.run_command(container, ["sudo", "-u", os.environ['BUILDER_NAME'], "%s/build.sh" % build_path, unpacked_netdata, new_version])
77
78 print("Listing contents on build path")