def base_app(tmp_shared_volume_path):
    """Flask application fixture."""
    config_mapping = {
        'SERVER_NAME': 'localhost:5000',
        'SECRET_KEY': 'SECRET_KEY',
        'TESTING': True,
        'SHARED_VOLUME_PATH': tmp_shared_volume_path,
        'SQLALCHEMY_DATABASE_URI': 'sqlite:///',
        'SQLALCHEMY_TRACK_MODIFICATIONS': False,
        'ORGANIZATIONS': ['default'],
    }
    app_ = create_app(config_mapping)
    return app_
예제 #2
0
def base_app(tmp_shared_volume_path):
    """Flask application fixture."""
    config_mapping = {
        "SERVER_NAME": "localhost:5000",
        "SECRET_KEY": "SECRET_KEY",
        "TESTING": True,
        "SHARED_VOLUME_PATH": tmp_shared_volume_path,
        "SQLALCHEMY_DATABASE_URI": "sqlite:///testdb.db",
        "SQLALCHEMY_TRACK_MODIFICATIONS": False,
        "ORGANIZATIONS": ["default"],
    }
    app_ = create_app(config_mapping)
    return app_
def base_app(tmp_shared_volume_path):
    """Flask application fixture."""
    config_mapping = {
        "SERVER_NAME": "localhost:5000",
        "SECRET_KEY": "SECRET_KEY",
        "TESTING": True,
        "SHARED_VOLUME_PATH": tmp_shared_volume_path,
        "SQLALCHEMY_DATABASE_URI": os.getenv("REANA_SQLALCHEMY_DATABASE_URI"),
        "SQLALCHEMY_TRACK_MODIFICATIONS": False,
        "FLASK_ENV": "development",
        "ORGANIZATIONS": ["default"],
    }
    app_ = create_app(config_mapping=config_mapping)
    return app_
예제 #4
0
# -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2017, 2018 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""REANA Workflow Controller Instance."""

import threading

from flask import current_app

from reana_workflow_controller.factory import create_app

app = create_app()


@app.teardown_appcontext
def shutdown_session(response_or_exc):
    """Close session on app teardown."""
    current_app.session.remove()
    return response_or_exc


if __name__ == "__main__":
    app.run(host="0.0.0.0")