2015-04-08 22:43:59 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
(function () {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The BuildsService provides access to build
|
|
|
|
* data using REST API calls.
|
|
|
|
*/
|
|
|
|
function BuildService($http, $window) {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets a list of builds.
|
|
|
|
*
|
|
|
|
* @param {string} Name of the repository.
|
|
|
|
*/
|
|
|
|
this.list = function(repoName) {
|
2015-04-15 05:04:38 +00:00
|
|
|
return $http.get('/api/repos/'+repoName+'/builds');
|
2015-04-08 22:43:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets a build.
|
|
|
|
*
|
|
|
|
* @param {string} Name of the repository.
|
|
|
|
* @param {number} Number of the build.
|
|
|
|
*/
|
|
|
|
this.get = function(repoName, buildNumber) {
|
2015-04-15 05:04:38 +00:00
|
|
|
return $http.get('/api/repos/'+repoName+'/builds/'+buildNumber);
|
2015-04-08 22:43:59 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
angular
|
|
|
|
.module('drone')
|
|
|
|
.service('builds', BuildService);
|
2015-04-15 05:04:38 +00:00
|
|
|
})();
|