示例#1
0
 def create_app(self):
     settings.TESTING = True
     settings.PRESERVE_CONTEXT_ON_EXCEPTION = False
     ProjectTrigger.fernet = Fernet(Fernet.generate_key())
     permissions.INTERNAL_API_KEY = 'just for testing'.encode()
     local_storage.SIGNING_KEY = permissions.INTERNAL_API_KEY
     return create_app(settings)
示例#2
0
import sys

import click
import requests

from sqlalchemy.orm.exc import NoResultFound

from jobserv.flask import create_app
from jobserv.git_poller import run
from jobserv.models import (Build, BuildStatus, Project, ProjectTrigger, Run,
                            TriggerTypes, Worker, db)
from jobserv.notify import email_on_exception
from jobserv.storage import Storage
from jobserv.worker import run_monitor_workers

app = create_app()


@app.cli.command()
def run_git_poller():
    run()


@app.cli.command()
def monitor_workers():
    run_monitor_workers()


@app.cli.group()
def project():
    pass