mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 14:29:51 -04:00
Merge pull request #141 from alphagov/update_version_status_info
Updated status endpoint info from travis build time and commit.
This commit is contained in:
@@ -174,10 +174,12 @@ def register_errorhandlers(application):
|
|||||||
|
|
||||||
|
|
||||||
def get_app_version():
|
def get_app_version():
|
||||||
_version_re = re.compile(r'__version__\s+=\s+(.*)')
|
build = 'n/a'
|
||||||
version = 'n/a'
|
build_time = "n/a"
|
||||||
dir_path = os.path.dirname(os.path.abspath(__file__))
|
try:
|
||||||
with open(os.path.join(dir_path, 'version.py'), 'rb') as f:
|
from app import version
|
||||||
version = str(ast.literal_eval(_version_re.search(
|
build = version.__build__
|
||||||
f.read().decode('utf-8')).group(1)))
|
build_time = version.__time__
|
||||||
return version
|
except:
|
||||||
|
pass
|
||||||
|
return build, build_time
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ def status():
|
|||||||
api_status = status_api_client.get_status()
|
api_status = status_api_client.get_status()
|
||||||
except:
|
except:
|
||||||
api_status = 'n/a'
|
api_status = 'n/a'
|
||||||
|
build, build_time = get_app_version()
|
||||||
return jsonify(status="ok",
|
return jsonify(status="ok",
|
||||||
app_version=get_app_version(),
|
api_status=api_status,
|
||||||
api_status=api_status), 200
|
api_build=build,
|
||||||
|
api_built_time=build_time), 200
|
||||||
|
|||||||
@@ -1 +1,2 @@
|
|||||||
__version__ = '0.1.1'
|
__build__ = ""
|
||||||
|
__time__ = ""
|
||||||
|
|||||||
Reference in New Issue
Block a user