- Add a build now command to the trigger

- Have the trigger description use the master_branch in the config
This commit is contained in:
Joseph Schorr 2014-02-25 19:53:41 -05:00
parent 011490d36d
commit 206049dbf8
5 changed files with 35 additions and 5 deletions

View file

@ -1469,7 +1469,7 @@ def manually_start_build_trigger(namespace, repository, trigger_uuid):
handler = BuildTrigger.get_trigger_for_service(trigger.service.name)
existing_config_dict = json.loads(trigger.config)
if handler.is_active(existing_config_dict):
if not handler.is_active(existing_config_dict):
abort(400)
return

View file

@ -4,11 +4,18 @@
Push to GitHub repository <a href="https://github.com/{{ trigger.config.build_source }}" target="_new">{{ trigger.config.build_source }}</a>
<div style="margin-top: 4px; margin-left: 26px; font-size: 12px; color: gray;" ng-if="trigger.config.subdir">
<span>Dockerfile:
<a href="https://github.com/{{ trigger.config.build_source }}/tree/master/{{ trigger.config.subdir }}/Dockerfile" target="_blank">
<a href="https://github.com/{{ trigger.config.build_source }}/tree/{{ trigger.config.master_branch || 'master' }}/{{ trigger.config.subdir }}/Dockerfile" target="_blank">
//{{ trigger.config.subdir }}/Dockerfile
</a>
</span>
</div>
<div style="margin-top: 4px; margin-left: 26px; font-size: 12px; color: gray;" ng-if="!trigger.config.subdir">
<span>Dockerfile:
<a href="https://github.com/{{ trigger.config.build_source }}/tree/{{ trigger.config.master_branch || 'master' }}/Dockerfile" target="_blank">
//Dockerfile
</a>
</span>
</div>
</span>
<span ng-switch-default>
Unknown

View file

@ -132,9 +132,7 @@ quayApp = angular.module('quay', ['ngRoute', 'chieffancypants.loadingBar', 'angu
var source = $sanitize(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 ';
desc += '<a href="https://github.com/' + source + '" target="_blank">' + source + '</a>';
if (config['subdir']) {
desc += '<br>Dockerfile folder: ' + UtilService.textToSafeHtml(config['subdir']);
}
desc += '<br>Dockerfile folder: //' + UtilService.textToSafeHtml(config['subdir']);
return desc;
default:

View file

@ -1470,6 +1470,30 @@ function RepoAdminCtrl($scope, Restangular, ApiService, KeyService, $routeParams
$scope.currentSetupTrigger = null;
};
$scope.startTrigger = function(trigger) {
var params = {
'repository': namespace + '/' + name,
'trigger_uuid': trigger.id
};
ApiService.manuallyStartBuildTrigger(null, params).then(function(resp) {
window.console.log(resp);
var url = '/repository/' + namespace + '/' + name + '/build?current=' + resp['id'];
document.location = url;
}, function(resp) {
bootbox.dialog({
"message": resp['message'] || 'The build could not be started',
"title": "Could not start build",
"buttons": {
"close": {
"label": "Close",
"className": "btn-primary"
}
}
});
});
};
$scope.deleteTrigger = function(trigger) {
var params = {
'repository': namespace + '/' + name,

View file

@ -262,6 +262,7 @@
</button>
<ul class="dropdown-menu dropdown-menu-right pull-right">
<li><a href="javascript:void(0)" ng-click="setupTrigger(trigger)" ng-show="!trigger.is_active"><i class="fa fa-wrench"></i>Resume Setup</a></li>
<li><a href="javascript:void(0)" ng-click="startTrigger(trigger)" ng-show="trigger.is_active"><i class="fa fa-tasks"></i>Build Now</a></li>
<li><a href="javascript:void(0)" ng-click="deleteTrigger(trigger)"><i class="fa fa-times"></i>Delete Trigger</a></li>
</ul>
</div>