def create_app(self): """ It initializes flask_testing """ tmp_directory = tempfile.mkdtemp() app = alde.create_app_v1(self.SQLALCHEMY_DATABASE_URI, 0, tmp_directory, tmp_directory, ['APP_TYPE'], None, None) app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True app.config['TESTING'] = self.TESTING db.create_all() # We register the upload url upload_prefix = alde.url_prefix_v1 + "/upload" app.register_blueprint(upload.upload_blueprint, url_prefix=upload_prefix) # We create the application and we store it in the db application = Application() application.name = "AppName" db.session.add(application) db.session.commit() return app
def main(): # pragma: no cover """ Main function that starts the ALDE Flask Service """ parser = argparse.ArgumentParser( description='Application Lifecycle Deployment Engine') parser.add_argument('--config', type=str, default='alde_configuration.ini', help='configuration file path') args = parser.parse_args() conf = load_config(args.config) # pragma: no cover log_config(conf) logger.info("Starting ALDE") # pragma: no cover app = alde.create_app_v1(conf['SQL_LITE_URL'], conf['PORT'], conf['APP_UPLOAD_FOLDER'], conf['APP_PROFILE_FOLDER'], conf['APP_TYPES'], conf['COMPARATOR_PATH'], conf['COMPARATOR_FILE']) # pragma: no cover # We start the Flask loop db.create_all() # pragma: no cover # We register the upload url upload_prefix = alde.url_prefix_v1 + "/upload" app.register_blueprint(upload.upload_blueprint, url_prefix=upload_prefix) app.run(host=conf['HOST'], port=conf['PORT'], use_reloader=False)
def create_app(self): """ It initializes the application """ app = alde.create_app_v1(self.SQLALCHEMY_DATABASE_URI, 5101, self.APP_FOLDER, self.APP_FOLDER, self.APP_TYPES, self.COMPARATOR_PATH, self.COMPARATOR_FILE) app.scheduler.shutdown() return app
def main(): # pragma: no cover """ Main function that starts the ALDE Flask Service """ conf = load_config() # pragma: no cover logger.info("Starting ALDE") # pragma: no cover app = alde.create_app_v1(conf['SQL_LITE_URL'], conf['PORT'], conf['APP_UPLOAD_FOLDER'], conf['APP_PROFILE_FOLDER'], conf['APP_TYPES'], conf['COMPARATOR_PATH'], conf['COMPARATOR_FILE'] ) # pragma: no cover # We start the Flask loop db.create_all() # pragma: no cover # We register the upload url upload_prefix = alde.url_prefix_v1 + "/upload" app.register_blueprint(upload.upload_blueprint, url_prefix=upload_prefix) app.run(use_reloader=False)