summaryrefslogtreecommitdiffstats
path: root/.travis
diff options
context:
space:
mode:
authorPaul Emm. Katsoulakis <34388743+paulkatsoulakis@users.noreply.github.com>2019-09-05 10:27:35 +0300
committerChris Akritidis <43294513+cakrit@users.noreply.github.com>2019-09-05 09:27:35 +0200
commit82ad790da7d59f6bf317009c580c07fe09e53e3d (patch)
treece391460727c962cf839a249aa610f31156755eb /.travis
parent54477ae3d8906c2ef26b5fa497552fee25ab1bde (diff)
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
Diffstat (limited to '.travis')
-rwxr-xr-x.travis/package_management/trigger_deb_lxc_build.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/.travis/package_management/trigger_deb_lxc_build.py b/.travis/package_management/trigger_deb_lxc_build.py
index a0235a73d1..46b64e6a95 100755
--- a/.travis/package_management/trigger_deb_lxc_build.py
+++ b/.travis/package_management/trigger_deb_lxc_build.py
@@ -53,18 +53,26 @@ unpacked_netdata = netdata_tarball.replace(".tar.gz", "")
print("Extracting tarball %s" % netdata_tarball)
common.run_command(container, ["sudo", "-u", os.environ['BUILDER_NAME'], "tar", "xf", netdata_tarball, "-C", build_path])
+print("Checking version consistency")
+since_version = os.environ["LATEST_RELEASE_VERSION"]
+if str(since_version).replace('v', '') == str(new_version) and str(new_version).count('.') == 2:
+ s = since_version.split('.')
+ prev = str(int(s[1]) - 1)
+ since_version = s[0] + '.' + prev + s[2]
+ print("We seem to be building a new stable release, reduce by one since_version option. New since_version:%s" % since_version)
+
print("Fixing changelog tags")
changelog_in_host = "contrib/debian/changelog"
-common.run_command_in_host(['sed', '-i', 's/PREVIOUS_PACKAGE_VERSION/%s-1/g' % os.environ["LATEST_RELEASE_VERSION"].replace("v", ""), changelog_in_host])
+common.run_command_in_host(['sed', '-i', 's/PREVIOUS_PACKAGE_VERSION/%s-1/g' % since_version.replace("v", ""), changelog_in_host])
common.run_command_in_host(['sed', '-i', 's/PREVIOUS_PACKAGE_DATE/%s/g' % os.environ["LATEST_RELEASE_DATE"], changelog_in_host])
print("Executing gbp dch command..")
-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])
+common.run_command_in_host(['gbp', 'dch', '--release', '--ignore-branch', '--spawn-editor=snapshot', '--since=%s' % since_version, '--new-version=%s' % new_version])
print("Copying over changelog to the destination machine")
common.run_command_in_host(['sudo', 'cp', 'debian/changelog', "%s/%s/netdata-%s/contrib/debian/" % (os.environ['LXC_CONTAINER_ROOT'], build_path, new_version)])
-print("Running debian build script since %s" % os.environ["LATEST_RELEASE_VERSION"])
+print("Running debian build script since %s" % since_version)
common.run_command(container, ["sudo", "-u", os.environ['BUILDER_NAME'], "%s/build.sh" % build_path, unpacked_netdata, new_version])
print("Listing contents on build path")