Merge branch 'master' into gitlab

This commit is contained in:
Joseph Schorr 2015-05-03 12:13:09 -04:00
commit e3aededcbc
70 changed files with 1000 additions and 265 deletions

View file

@ -54,6 +54,14 @@ angular.module('quay').factory('TriggerService', ['UtilService', '$sanitize', 'K
'templates': {
'credentials': '/static/directives/trigger/githost/credentials.html',
'trigger-description': '/static/directives/trigger/github/trigger-description.html'
},
'repository_url': function(build) {
return KeyService['githubTriggerEndpoint'] + build.trigger.build_source;
},
'link_templates': {
'commit': '/commit/{sha}',
'branch': '/tree/{branch}',
'tag': '/releases/tag/{tag}',
}
},
@ -85,6 +93,14 @@ angular.module('quay').factory('TriggerService', ['UtilService', '$sanitize', 'K
'templates': {
'credentials': '/static/directives/trigger/githost/credentials.html',
'trigger-description': '/static/directives/trigger/bitbucket/trigger-description.html'
},
'repository_url': function(build) {
return 'https://bitbucket.org/' + build.trigger.build_source;
},
'link_templates': {
'commit': '/commits/{sha}',
'branch': '/branch/{branch}',
'tag': '/commits/tag/{tag}',
}
},
@ -160,6 +176,26 @@ angular.module('quay').factory('TriggerService', ['UtilService', '$sanitize', 'K
});
};
triggerService.getFullLinkTemplate = function(build, templateName) {
var name = build.trigger.service;
var type = triggerTypes[name];
if (!type) {
return null;
}
var repositoryUrl = type.repository_url;
if (!repositoryUrl) {
return null;
}
var linkTemplate = type.link_templates;
if (!linkTemplate || !linkTemplate[templateName]) {
return null;
}
return repositoryUrl(build) + linkTemplate[templateName];
};
triggerService.supportsFullListing = function(name) {
var type = triggerTypes[name];
if (!type) {