fix: Check update not checking update when testing version was selected.

This commit is contained in:
Terry Geng 2020-11-30 01:08:11 +08:00
parent 892a1863e7
commit 2546e3b373
No known key found for this signature in database
GPG Key ID: F982F8EA1DF720E7
2 changed files with 3 additions and 3 deletions

View File

@ -32,7 +32,8 @@ steps:
commands:
- apt-get -qq update && apt-get -qq install git > /dev/null
- sed -i 's/target_version = git/target_version = testing/' configuration.default.ini
- version=$(git rev-parse HEAD)
- git fetch --tags
- version=$(git describe --tags)
- echo "current git commit is $version"
- echo $version > /mnt/botamusique/testing-version
- sed -i "s/version = 'git'/version = '$version'/" mumbleBot.py

View File

@ -118,8 +118,7 @@ def check_update(current_version):
global log
log.debug("update: checking for updates...")
new_version = new_release_version(var.config.get('bot', 'target_version'))
if version.parse(new_version) > version.parse(current_version) \
and var.config.get('bot', 'target_version') == "stable":
if version.parse(new_version) > version.parse(current_version):
changelog = fetch_changelog()
log.info(f"update: new version {new_version} found, current installed version {current_version}.")
log.info(f"update: changelog: {changelog}")