Ejemplo n.º 1
0
$input = $_GET + $_POST;
parse_str(implode('&', array_slice($argv, 1)), $input);
$owner = getCliArgOrInputParam('owner');
$githubApiToken = getCliArgOrInputParam('github_api_token', getenv('github_token_env_var'));
$releasableRepo = getCliArgOrInputParam('releasable_repo');
$whitelistDeps = getCliArgOrInputParam('whitelist_deps', []);
$blacklistDeps = getCliArgOrInputParam('blacklist_deps', []);
$type = getCliArgOrInputParam('type', 'minor');
$baseRef = getCliArgOrInputParam('base_ref', 'master');
$mode = getCliArgOrInputParam('mode', 'sandbox');
$updateComposer = getCliArgOrInputParam('composer_update', 'true');
if ($updateComposer == 'true') {
    `composer update -v && composer dumpautoload -o`;
}
$releaser = new \Releaser\Releaser($githubApiToken, $owner);
$releaser->release($releasableRepo, $whitelistDeps, $blacklistDeps, $type, $baseRef, $mode);
/**
 * @param string $parameter
 */
function getCliArgOrInputParam($parameter, $default = null)
{
    global $input;
    if (!isset($input[$parameter]) && $default) {
        return useDefaultParam($parameter, $default);
    }
    return $input[$parameter];
}
/**
 * @param string $message
 */
function message($message = '')
Ejemplo n.º 2
0
<?php 
require __DIR__ . '/../src/Releaser/Releaser.php';
$releaser = new \Releaser\Releaser('github_api_token', 'github_repo_owner');
$releaser->release('repo_to_release', ['release_repos_with_these_keywords_in_name'], ['skip_repos_with_these_keywords_in_name'], 'minor', 'master', 'interactive');