Ejemplo n.º 1
0
 def create_app(self):
     app.init_app({
         'SQLALCHEMY_URL': 'sqlite://',
         'SQLALCHEMY_ECHO': False,
     })
     Base.metadata.bind = app.session.get_bind()
     Base.metadata.create_all()
     return app
Ejemplo n.º 2
0
def get_app_config(key):
    opath = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
    if opath not in sys.path:
        sys.path.insert(0, opath)
        
    from ADSDeploy import app
    app.init_app()
    
    print 'Getting actual config for', key, app.config.get(key)
    return app.config.get(key)
Ejemplo n.º 3
0
    def setUp(self):
        # Create queue
        with MiniRabbit(RABBITMQ_URL) as w:
            w.make_queue("in", exchange="test")
            w.make_queue("ads.deploy.deploy", exchange="test")
            w.make_queue("ads.deploy.restart", exchange="test")
            w.make_queue("database", exchange="test")
            w.make_queue("error", exchange="test")

        # Create database
        app.init_app({"SQLALCHEMY_URL": "sqlite://", "SQLALCHEMY_ECHO": False})
        Base.metadata.bind = app.session.get_bind()
        Base.metadata.create_all()
        self.app = app
    def setUp(self):
        # Create queue
        with MiniRabbit(RABBITMQ_URL) as w:
            w.make_queue('in', exchange='test')
            w.make_queue('out', exchange='test')
            w.make_queue('database', exchange='test')

        # Create database
        app.init_app({
            'SQLALCHEMY_URL': 'sqlite://',
            'SQLALCHEMY_ECHO': False,
        })
        Base.metadata.bind = app.session.get_bind()
        Base.metadata.create_all()
        self.app = app
Ejemplo n.º 5
0
 def setUp(self):
     # Create database
     app.init_app({
         'SQLALCHEMY_URL': 'sqlite://',
         'SQLALCHEMY_ECHO': False,
         'EB_DEPLOY_HOME': os.path.abspath('../../../eb-deploy')
     })
     
     # Create queue
     with MiniRabbit(app.config.get('RABBITMQ_URL')) as w:
         w.make_queue('in', exchange='test')
         w.make_queue('out', exchange='test')
         w.make_queue('database', exchange='test')
         w.make_queue('error', exchange='test')
         
     Base.metadata.bind = app.session.get_bind()
     Base.metadata.create_all()
     self.app = app
Ejemplo n.º 6
0
def main():
    import argparse
    parser = argparse.ArgumentParser(description='Process user input.')

    parser.add_argument('--no-consume-queue',
                        dest='test_run',
                        action='store_true',
                        help='Worker will exit the queue after consuming a '
                             'single message.')

    parser.add_argument('--consume-queue',
                        dest='test_run',
                        action='store_false',
                        help='Worker will sit on the queue, continuously '
                             'consuming.')


    parser.set_defaults(test_run=False)
    args = parser.parse_args()

    params_dictionary = {'TEST_RUN': args.test_run}
    
    app.init_app()
    start_pipeline(params_dictionary, app)
Ejemplo n.º 7
0
                        dest='run_example',
                        action='store',
                        type=str,
                        help='Path to input file to import')
    
    parser.add_argument('-p',
                        '--start_pipeline',
                        dest='start_pipeline',
                        action='store_true',
                        help='Start the pipeline')
    
    parser.set_defaults(purge_queues=False)
    parser.set_defaults(start_pipeline=False)
    args = parser.parse_args()
    
    app.init_app()
    
    work_done = False
    if args.purge_queues:
        purge_queues(app.config.get('WORKERS'))
        sys.exit(0)

    if args.start_pipeline:
        start_pipeline()
        work_done = True
        
    if args.import_claims:
        # Send the files to be put on the queue
        run_example(args.import_claims)
        work_done = True
        
Ejemplo n.º 8
0
 def create_app(self):
     """Does not mess with a db, it expects it to exist"""
     app.init_app()
     return app
Ejemplo n.º 9
0
 def create_app(self):
     app.init_app({"SQLALCHEMY_URL": "sqlite://", "SQLALCHEMY_ECHO": False})
     Base.metadata.bind = app.session.get_bind()
     Base.metadata.create_all()
     return app