Ejemplo n.º 1
0
    def setUp(self):
        self.pipeline = Mock(**{"status": ""})
        self.patchBitbucketNotifications()
        self.patchJenkinsNotifications()

        self.app = AppMock()
        setup_routes(self.app, [self.pipeline])
Ejemplo n.º 2
0
def build_app():
    app = Flask("Pipeline Notifier")

    pipelines_config = json.loads(os.environ["PIPELINE_NOTIFIER_PIPELINES"])
    hipchat_token = os.environ["PIPELINE_NOTIFIER_HIPCHAT_TOKEN"]
    hipchat_room = os.environ["PIPELINE_NOTIFIER_HIPCHAT_ROOM"]

    notifier = HipchatNotifier(hipchat_token, hipchat_room)
    pipelines = build_pipelines(pipelines_config, notifier)

    setup_routes(app, pipelines)
    return app