sethcarstens/github-php-deploybot

PHP类,您可以将其作为库引入并配置以帮助通过Github标签和版本进行自动化部署

0.1.1 2017-09-28 20:48 UTC

This package is auto-updated.

Last update: 2024-09-08 11:00:58 UTC


README

Alpha版本发布

主分支仍然是alpha版本。由于我们在将其从当前私有仓库迁移到公共通用发布版本的过程中进行了大量重构,因此代码未经测试。

目录

安装

Composer风格(推荐)

通过Composer命令行,例如

composer require sethcarstens/github-php-deploybot && composer install

手动安装

  1. https://api.github.com/repos/scarstens/github-php-deploybot/zipball 下载此存储库的最新副本
  2. 解压缩zip文件,并将src PHP文件复制到您的插件项目中。
  3. 使用SSI(服务器端包含)将文件包含到您的插件中。

使用

有关详细信息,请参阅 webhook-endpoint-example.php 文件。

简单示例

custom-endpoint.php

<?php
$debug_level = 2;
include_once __DIR__ . 'vendor/autoload.php';
$config_file = __DIR__ . 'config.php';
$deploy_bot = new Github_Php_Deploybot\Deployment( json_decode( fgets( STDIN ) ), $debug_level, $config_file );
$deploy_bot->deploy_repo();