Merge pull request #3150 from freqtrade/version_docker

[minor] have version-detection fall back to freqtrade_commit
This commit is contained in:
Matthias 2020-04-14 15:53:05 +02:00 committed by GitHub
commit c8ccdbcb9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,4 +24,11 @@ if __version__ == 'develop':
# stderr=subprocess.DEVNULL).decode("utf-8").rstrip().strip('"') # stderr=subprocess.DEVNULL).decode("utf-8").rstrip().strip('"')
except Exception: except Exception:
# git not available, ignore # git not available, ignore
try:
# Try Fallback to freqtrade_commit file (created by CI while building docker image)
from pathlib import Path
versionfile = Path('./freqtrade_commit')
if versionfile.is_file():
__version__ = f"docker-{versionfile.read_text()[:8]}"
except Exception:
pass pass