geocodio / drone-ci-client
Drone CI 的简单、轻量级 PHP 客户端
dev-main
2023-04-27 09:59 UTC
Requires
- php: ^7.2|^8.0
- guzzlehttp/guzzle: ^6.3|^7.0
Requires (Dev)
- phpunit/phpunit: ^8.2
- symfony/var-dumper: ^4.3
This package is auto-updated.
Last update: 2024-08-27 12:40:16 UTC
README
Drone CI 的简单、轻量级 PHP 客户端 Drone CI
安装
您可以通过 composer 安装此包
$ composer require geocodio/drone-ci-client
使用 Laravel?太棒了!有一个可选的 Laravel 服务提供者,可以轻松集成到您的应用程序中。
使用
$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);
与 Laravel 的使用
此库在没有 Laravel 的情况下也能很好地工作,但如果您使用 Laravel,可以享受一些 Laravel 特定的功能。
新版本的 Laravel 会自动发现此包,因此您只需要发布配置文件即可。
php artisan vendor:publish --provider="Geocodio\Drone\DroneServiceProvider"
现在您可以在 config/drone.php
中编辑您的配置文件。
现在您可以使用 Drone
门面,或者 依赖注入 完全配置的 Drone
类。
// 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
变更日志
有关最近更改的更多信息,请参阅 CHANGELOG。
安全
如果您发现任何与安全相关的问题,请通过电子邮件 security@geocod.io 而不是使用问题跟踪器。
许可
MIT 许可证 (MIT)。有关更多信息,请参阅 许可文件。