HomeDevCentral

Docker Hub registry support

Description

Docker Hub registry support

Summary:
Payloads are similar to GitHub API ones, but much easier to handle
as there is only one kind of them: push events.

We add a DockerHubPayloadEvent, and fire relevant notification.

Test Plan:
Post the following test payload to /gate/DockerHub/Nasqueron:

{
    "push_data": {
        "pushed_at": 1450783957,
        "images": [
            "imagehash1",
            "imagehash2",
            "imagehash3"
        ],
        "pusher": "dereckson"
    },
    "callback_url": "https://registry.hub.docker.com/u/nasqueron/rabbitmq/hook/2ej0d3b34dj3d4c41c52be5j5cj1f5f01/",
    "repository": {
        "status": "Active",
        "description": "RabbitMQ wth management, MQTT and STOMP plugins.",
        "is_trusted": true,
        "full_description": "```\n              RabbitMQ Docker image, with management, STOMP and MQTT\n  ##  ##      \n  ##  ##      Usage:  docker pull nasqueron/rabbitmq\n  ##########          mkdir /data/blue-rabbit\n  ######  ##          ./run-mq blue-rabbit\n  ##########\n              This work is based on the Docker library RabbitMQ image.\n```",
        "repo_url": "https://registry.hub.docker.com/u/nasqueron/rabbitmq/",
        "owner": "nasqueron",
        "is_official": false,
        "is_private": false,
        "name": "rabbitmq",
        "namespace": "nasqueron",
        "star_count": 0,
        "comment_count": 0,
        "date_created": 1447975876,
        "dockerfile": "FROM rabbitmq:latest\n\nRUN rabbitmq-plugins enable --offline rabbitmq_management && \\\n    rabbitmq-plugins enable --offline rabbitmq_mqtt && \\\n    rabbitmq-plugins enable --offline rabbitmq_stomp && \\\n    rabbitmq-plugins enable --offline rabbitmq_web_stomp\n\nEXPOSE 1883 8883 15672 15674 61613\n",
        "repo_name": "nasqueron/rabbitmq"
    }
}

Wearg, which subscribes to notifications and prints them on IRC channel
successfully received this for Nasqueron project, docker group:

12:04:59 < Wearg> New image pushed to Docker Hub registry for nasqueron/rabbitmq
by dereckson — https://registry.hub.docker.com/u/nasqueron/rabbitmq/

Reviewers: dereckson

Maniphest Tasks: T630

Differential Revision: http://devcentral.nasqueron.org/D113

Details

Provenance
derecksonAuthored on
Differential Revision
D113: Docker Hub registry support
Parents
rNOTIF03d4d9566c3a: Phabricator notifications now supports repos without any project
Branches
Unknown
Tags
Unknown