trigger: pass trigger into manual_start & handle_trigger_request
This commit is contained in:
parent
b851986cf5
commit
d29c8d60c7
3 changed files with 41 additions and 38 deletions
|
@ -1,5 +1,4 @@
|
|||
import logging
|
||||
import json
|
||||
|
||||
from flask import request, make_response, Blueprint
|
||||
|
||||
|
@ -9,7 +8,6 @@ from auth.auth import process_auth
|
|||
from auth.permissions import ModifyRepositoryPermission
|
||||
from util.invoice import renderInvoiceToHtml
|
||||
from util.useremails import send_invoice_email, send_subscription_change, send_payment_failed
|
||||
from util.names import parse_repository_name
|
||||
from util.http import abort
|
||||
from endpoints.trigger import BuildTrigger, ValidationRequestException, SkipRequestException
|
||||
from endpoints.common import start_build
|
||||
|
@ -23,7 +21,7 @@ webhooks = Blueprint('webhooks', __name__)
|
|||
@webhooks.route('/stripe', methods=['POST'])
|
||||
def stripe_webhook():
|
||||
request_data = request.get_json()
|
||||
logger.debug('Stripe webhook call: %s' % request_data)
|
||||
logger.debug('Stripe webhook call: %s', request_data)
|
||||
|
||||
customer_id = request_data.get('data', {}).get('object', {}).get('customer', None)
|
||||
user = model.get_user_or_org_by_customer_id(customer_id) if customer_id else None
|
||||
|
@ -87,10 +85,8 @@ def build_trigger_webhook(trigger_uuid, **kwargs):
|
|||
handler = BuildTrigger.get_trigger_for_service(trigger.service.name)
|
||||
|
||||
logger.debug('Passing webhook request to handler %s', handler)
|
||||
config_dict = json.loads(trigger.config)
|
||||
try:
|
||||
specs = handler.handle_trigger_request(request, trigger.auth_token,
|
||||
config_dict)
|
||||
specs = handler.handle_trigger_request(request, trigger)
|
||||
dockerfile_id, tags, name, subdir, metadata = specs
|
||||
|
||||
except ValidationRequestException:
|
||||
|
|
Reference in a new issue