Simple, lightweight PHP client for Drone CI
You can install the package via composer:
$ composer require geocodio/drone-ci-client
Using Laravel? Great! There's an optional Laravel service provider, for easy integration into your app.
$server = 'https://my-drone-ci-server.com';
$token = 'MyDroneAuthenticationToken';
$client = new Geocodio\Drone\Drone($server, $token);
$client->builds(string $owner, string $name);
$client->repo(string $owner, string $name);
$client->repoList();
$client->build(string $owner, string $name, int $num);
$client->buildLast(string $owner, string $name, string $branch = null);
$client->buildList(string $owner, string $name, array $options = []);
$client->promote(string $namespace, string $name, int $build, string $target, array $options = []);
$client->logs(string $owner, string $name, int $build, string $stage, int $step);
This library works well without Laravel, but if you happen to be using Laravel you can enjoy a few Laravel-specific features.
The package will be auto-discovered by newer Laravel versions, so the only thing left to do is to publish the config file
php artisan vendor:publish --provider="Geocodio\Drone\DroneServiceProvider"
You can now go ahead and edit your config file at config/drone.php
.
You will now be able to use the Drone
facade, or dependency inject the fully-configured Drone
class.
// Using facade
use Drone;
$builds = Drone::builds(string $owner, string $name);
// Using dependency injection
use Geocodio\Drone\Drone;
class SomeController {
public function __construct(Drone $drone) {
$builds = $drone->builds(string $owner, string $name);
}
}
$ composer test
Please see CHANGELOG for more information on what has changed recently.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.