Add support for the remaining events to the frontend and the backend
This commit is contained in:
parent
f7c154abb5
commit
af31bde997
7 changed files with 269 additions and 40 deletions
|
@ -17,6 +17,7 @@ from auth.permissions import (ModifyRepositoryPermission, UserAdminPermission,
|
|||
ReadRepositoryPermission, CreateRepositoryPermission)
|
||||
|
||||
from util.http import abort
|
||||
from endpoints.common import spawn_notification
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -307,7 +308,7 @@ def update_images(namespace, repository):
|
|||
'action': 'pushed_repo',
|
||||
'repository': repository,
|
||||
'namespace': namespace
|
||||
}
|
||||
}
|
||||
|
||||
event = userevents.get_event(username)
|
||||
event.publish_event_data('docker-cli', user_data)
|
||||
|
@ -318,28 +319,13 @@ def update_images(namespace, repository):
|
|||
# Generate a job for each notification that has been added to this repo
|
||||
profile.debug('Adding notifications for repository')
|
||||
|
||||
repo_string = '%s/%s' % (namespace, repository)
|
||||
event_data = {
|
||||
'repository': repo_string,
|
||||
'namespace': namespace,
|
||||
'name': repository,
|
||||
'docker_url': 'quay.io/%s' % repo_string,
|
||||
'homepage': 'https://quay.io/repository/%s' % repo_string,
|
||||
'visibility': repo.visibility.name,
|
||||
'updated_tags': updated_tags,
|
||||
'pushed_image_count': len(image_with_checksums),
|
||||
'pruned_image_count': num_removed
|
||||
}
|
||||
|
||||
notifications = model.list_repo_notifications(namespace, repository, event_name='repo_push')
|
||||
for notification in notifications:
|
||||
notification_data = {
|
||||
'notification_id': notification.id,
|
||||
'repository_id': repository.id,
|
||||
'event_data': event_data
|
||||
}
|
||||
notification_queue.put([namespace, repository, 'repo_push'], json.dumps(notification_data))
|
||||
|
||||
spawn_notification(repo, 'repo_push', event_data)
|
||||
return make_response('Updated', 204)
|
||||
|
||||
abort(403)
|
||||
|
|
Reference in a new issue