本文整理汇总了PHP中Release::exec方法的典型用法代码示例。如果您正苦于以下问题:PHP Release::exec方法的具体用法?PHP Release::exec怎么用?PHP Release::exec使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Release
的用法示例。
在下文中一共展示了Release::exec方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: uploadAsset
return $this->client->send($request)->json();
}
public function uploadAsset($id, $name, $contents, $contentType)
{
$request = $this->client->createRequest('POST', sprintf("https://api.github.com/repos/%s/%s/releases/%s/assets?name=%s", $this->owner, $this->repo, $id, $name), array('Content-Type' => $contentType), $contents);
return $this->client->send($request)->json();
}
}
$owner = 'aws';
$repo = 'aws-sdk-php';
$returnVal = shell_exec('which chag') or die('chag not found in path');
$token = getenv('OAUTH_TOKEN') or die('OAUTH_TOKEN environment var not found!');
$artifacts = realpath(__DIR__ . '/artifacts') or die('artifacts dir not found');
$stageDir = realpath($artifacts . '/staging') or die('stage dir not found');
$zip = realpath($artifacts . '/aws.zip') or die('zip not found');
$phar = realpath($artifacts . '/aws.phar') or die('phar not found');
// Get the latest changelog entry
chdir($stageDir);
$tag = Release::exec('chag get');
$contents = Release::exec('chag contents');
echo "Found tag: {$tag}\n\n{$contents}\n\n";
$release = new Release($token, $owner, $repo);
$res = $release->createRelease($tag, $contents, 'master', true);
echo "Created release: {$res['id']}\n";
// Upload the phar
$upload = $release->uploadAsset($res['id'], 'aws.phar', file_get_contents($phar), 'application/octet-stream');
echo "Uploaded asset: {$upload['browser_download_url']}\n";
// Upload the zip
$upload = $release->uploadAsset($res['id'], 'aws.zip', file_get_contents($zip), 'application/zip');
echo "Uploaded asset: {$upload['browser_download_url']}\n\n";
echo "Successfully create GitHub release\n";
示例2: array
// Build pre
// ---------------------------------------------------------------------------------------------------------------------
if (Project::haveName() && Project::havePreEnv()) {
$commands = array('ssh ' . Project::name() . '@' . Project::name() . '.pre.brzy.cz');
Release::display($commands);
if ($prev && ($prev = Release::confirm())) {
Release::exec($commands);
}
echo PHP_EOL . 'Check tests results:' . PHP_EOL . ' http://' . Project::name() . '.pre.brzy.cz:8088/logviewer/index.php?lines=200&tail=1&action=show&log=%2Fvar%2Fwww%2F' . Project::name() . '%2Flogs%2Fdeploy%2Ftests.log' . PHP_EOL;
} else {
$prev = true;
}
// ---------------------------------------------------------------------------------------------------------------------
// Push new tag to server
// ---------------------------------------------------------------------------------------------------------------------
$commands = array('git tag ' . $tag . ' ' . $commit, 'git push origin ' . $tag);
Release::display($commands);
if ($prev && ($prev = Release::confirm())) {
Release::exec($commands);
}
// ---------------------------------------------------------------------------------------------------------------------
// Run tests
// ---------------------------------------------------------------------------------------------------------------------
if (Project::haveStableEnv() && Project::haveTestbuilder()) {
$commands = array('ant tawc -Denvironment.name=stable');
Release::display($commands);
if ($prev && Release::confirm()) {
Release::exec($commands);
}
}
echo '└' . str_repeat('─', 78) . '┘' . PHP_EOL;