consolidate everything into one GitHub trigger
This commit is contained in:
parent
80ae3fd310
commit
f6f93e9079
6 changed files with 42 additions and 426 deletions
|
@ -8,45 +8,6 @@ angular.module('quay').factory('TriggerService', ['UtilService', '$sanitize', 'K
|
|||
|
||||
var triggerTypes = {
|
||||
'github': {
|
||||
'description': function(config) {
|
||||
var source = UtilService.textToSafeHtml(config['build_source']);
|
||||
var desc = '<i class="fa fa-github fa-lg" style="margin-left: 2px; margin-right: 2px"></i> Push to Github Repository (Deprecated) ';
|
||||
desc += '<a href="https://github.com/' + source + '" target="_blank">' + source + '</a>';
|
||||
desc += '<br>Dockerfile folder: //' + UtilService.textToSafeHtml(config['subdir']);
|
||||
return desc;
|
||||
},
|
||||
'run_parameters': [
|
||||
{
|
||||
'title': 'Branch',
|
||||
'type': 'option',
|
||||
'name': 'branch_name'
|
||||
}
|
||||
],
|
||||
'get_redirect_url': function(namespace, repository) {
|
||||
var redirect_uri = KeyService['githubRedirectUri'] + '/trigger/' +
|
||||
namespace + '/' + repository;
|
||||
|
||||
var authorize_url = KeyService['githubTriggerAuthorizeUrl'];
|
||||
var client_id = KeyService['githubTriggerClientId'];
|
||||
|
||||
return authorize_url + 'client_id=' + client_id +
|
||||
'&scope=repo,user:email&redirect_uri=' + redirect_uri;
|
||||
},
|
||||
'is_enabled': function() {
|
||||
return Features.GITHUB_BUILD;
|
||||
},
|
||||
'icon': 'fa-github',
|
||||
'title': function() {
|
||||
var isEnterprise = KeyService.isEnterprise('github-trigger');
|
||||
if (isEnterprise) {
|
||||
return 'GitHub Enterprise Repository Push (API)';
|
||||
}
|
||||
|
||||
return 'GitHub Repository Push (API)';
|
||||
}
|
||||
},
|
||||
|
||||
'github-git': {
|
||||
'description': function(config) {
|
||||
var source = UtilService.textToSafeHtml(config['build_source']);
|
||||
var desc = '<i class="fa fa-github fa-lg" style="margin-left: 2px; margin-right: 2px"></i> Push to Github Repository ';
|
||||
|
@ -63,7 +24,7 @@ angular.module('quay').factory('TriggerService', ['UtilService', '$sanitize', 'K
|
|||
],
|
||||
'get_redirect_url': function(namespace, repository) {
|
||||
var redirect_uri = KeyService['githubRedirectUri'] + '/trigger/' +
|
||||
namespace + '/' + repository + '/__git';
|
||||
namespace + '/' + repository;
|
||||
|
||||
// TODO(jschorr): Remove once the new layout is in place.
|
||||
if (CookieService.get('quay.exp-new-layout') == 'true') {
|
||||
|
@ -83,10 +44,10 @@ angular.module('quay').factory('TriggerService', ['UtilService', '$sanitize', 'K
|
|||
'title': function() {
|
||||
var isEnterprise = KeyService.isEnterprise('github-trigger');
|
||||
if (isEnterprise) {
|
||||
return 'GitHub Enterprise Repository Push (Deploy Key)';
|
||||
return 'GitHub Enterprise Repository Push';
|
||||
}
|
||||
|
||||
return 'GitHub Repository Push (Deploy Key)';
|
||||
return 'GitHub Repository Push';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue