HomeDevCentral

Send HTTP payload to Docker Hub to trigger a build

Description

Send HTTP payload to Docker Hub to trigger a build

Summary:
Until there, the library allowed to prepare payloads
to trigger a build. We implement two ways to actually
send them through a Guzzle client.

Through a TriggerBuild class:

$client = new Client; // A Guzzle client
$token = "00000000-0000-0000-0000-000000000000"; // Token on Docker Hub
$image = new DockerHubImage("acme", "foo");
$trigger = $image->getTriggerBuild($client, $token);
$trigger->sendPayloadForDockerTag("alpha");

Shorcut syntax to trigger a full build:

$client = new Client; // A Guzzle client
$token = "00000000-0000-0000-0000-000000000000"; // Token on Docker Hub
$image = new DockerHubImage("acme", "foo");
$image->triggerBuild($client, $token);

Fixes T965.

Test Plan: More unit tests

Reviewers: dereckson

Maniphest Tasks: T965

Differential Revision: https://devcentral.nasqueron.org/D647