add version number
This commit is contained in:
parent
5b953122c3
commit
646cb04d9a
3
app.py
3
app.py
|
@ -2,6 +2,7 @@ from flask import Flask
|
|||
from flask_sqlalchemy import SQLAlchemy
|
||||
from sqlalchemy import MetaData
|
||||
from flask_migrate import Migrate
|
||||
import version
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
|
@ -31,4 +32,4 @@ migrate = Migrate(app, db)
|
|||
sentry = None
|
||||
if 'SENTRY_DSN' in app.config:
|
||||
from raven.contrib.flask import Sentry
|
||||
sentry = Sentry(app, dsn=app.config['SENTRY_DSN'])
|
||||
sentry = Sentry(app, dsn=app.config['SENTRY_DSN'], release=version.version)
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
#!/bin/sh
|
||||
|
||||
while read old new refname; do
|
||||
branch=$(git rev-parse --abbrev-ref=strict ${refname})
|
||||
if [[ $branch == "deploy" ]]; then
|
||||
systemctl --user stop forget
|
||||
GIT_WORK_TREE='/home/codl/forget' git checkout -f deploy
|
||||
|
||||
(
|
||||
cd /home/codl/forget
|
||||
source venv/bin/activate
|
||||
pip install -r requirements.txt
|
||||
tools/write-version.sh
|
||||
FLASK_APP='forget.py' flask db upgrade
|
||||
)
|
||||
systemctl --user start forget
|
||||
fi
|
||||
done
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
cd $(dirname $0)/..
|
||||
git describe --tags --long --always | python -c 'from jinja2 import Template; print(Template("version=\"{{input}}\"").render(input=input()))' > version.py
|
||||
|
|
@ -0,0 +1 @@
|
|||
version="dev"
|
Loading…
Reference in New Issue