Re-automate versioning (#130)

This commit is contained in:
pluja 2020-11-05 19:15:11 +01:00
parent 417af1a5f1
commit 7316c3a70c
3 changed files with 19 additions and 5 deletions

View File

@ -775,9 +775,22 @@ def status():
filen = url_for('static', filename='img/open.png')
caniregister = True
version = config['version']
try:
with open ("version.txt", "r") as versionFile:
hsh=versionFile.readlines()[0]
update=versionFile.readlines()[1]
#tag=versionFile.readlines()[2]
except:
try:
tag = str(subprocess.check_output(["git", "describe", "--tags"]).strip())[2:-1]
hsh = str(subprocess.check_output(["git", "rev-parse", "--short", "HEAD"]).strip())[2:-1]
update = str(subprocess.check_output(["git", "log", "-1", "--format=%cd"]).strip())[2:-1]
except:
hsh="Unknown"
update="Unknown"
tag="Unknown"
return render_template('status.html', title='STATUS', count=count, max=config['maxInstanceUsers'], file=filen,
cani=caniregister, version=config['version'])
cani=caniregister, hash=hsh, update=update, tag=tag)
@app.route('/error/<errno>')

View File

@ -46,7 +46,9 @@
<div class="ui text container center aligned centered">
<div class="ui segments">
<div class="ui segment">
<p>Yotter version: <b><a href="https://github.com/ytorg/Yotter/tags">{{version}}</a></b></p>
<p>Yotter version: <b><a href="https://github.com/ytorg/Yotter/tags">{{tag}}</a></b></p>
<p>Latest update: <b><a href="https://github.com/ytorg/Yotter/commits/">{{update}}</a></b></p>
<p>Commit hash: <b><a href="https://github.com/ytorg/Yotter/commits/">{{hash}}</a></b></p>
</div>
</div>
</div>

View File

@ -11,6 +11,5 @@
"admin_message":"Message from the admin text",
"admin_user":"admin_username",
"max_old_user_days": 60,
"donate_url": "",
"version": "2020.11.05"
"donate_url": ""
}