Devin Smith 41e8600690 more deployment changes
partial #3787
added support for deployment to any repo path.
added tagging system
2014-11-18 16:08:23 -08:00

22 lines
675 B
PHP

<?php
class Cockpit_Github extends Cana_Model {
public static function commits($user, $repo) {
return c::github()->api('repo')->commits()->all($user, $repo, ['sha' => 'master']);
}
public static function createTag($user, $repo, $tag, $sha = '', $body = '') {
return true;
return c::github()->api('repo')->releases()->create($user, $repo, [
'tag_name' => $tag,
'target_commitish' => $sha,
'body' => $body
]);
}
public static function tags($user, $repo) {
$response = c::github()->getHttpClient()->get('repos/'.$user.'/'.$repo.'/git/refs/tags');
$tags = Github\HttpClient\Message\ResponseMediator::getContent($response);
return $tags;
}
}