Add ability to re-run a dockerfile build
This commit is contained in:
parent
540da00c64
commit
55d846061e
4 changed files with 67 additions and 2 deletions
|
@ -785,7 +785,28 @@ function RepoBuildCtrl($scope, Restangular, ApiService, $routeParams, $rootScope
|
|||
$scope.polling = false;
|
||||
|
||||
$scope.adjustLogHeight = function() {
|
||||
$('.build-logs').height($(window).height() - 365);
|
||||
$('.build-logs').height($(window).height() - 385);
|
||||
};
|
||||
|
||||
$scope.askRestartBuild = function(build) {
|
||||
$('#confirmRestartBuildModal').modal({});
|
||||
};
|
||||
|
||||
$scope.restartBuild = function(build) {
|
||||
$('#confirmRestartBuildModal').modal('hide');
|
||||
|
||||
var data = {
|
||||
'file_id': build['resource_key']
|
||||
};
|
||||
|
||||
var params = {
|
||||
'repository': namespace + '/' + name
|
||||
};
|
||||
|
||||
ApiService.requestRepoBuild(data, params).then(function(newBuild) {
|
||||
$scope.builds.push(newBuild);
|
||||
$scope.setCurrentBuild(newBuild['id'], true);
|
||||
});
|
||||
};
|
||||
|
||||
$scope.hasLogs = function(container) {
|
||||
|
|
|
@ -72,12 +72,37 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div style="margin-top: 10px">
|
||||
<span class="quay-spinner" ng-show="polling"></span>
|
||||
<button class="btn btn-default" ng-show="(build.phase == 'error' || build.phase == 'complete') && build.resource_key"
|
||||
ng-click="askRestartBuild(build)">
|
||||
<i class="fa fa-refresh"></i>
|
||||
Run Build Again
|
||||
</button>
|
||||
<span class="build-id">{{ build.id }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal message dialog -->
|
||||
<div class="modal fade" id="confirmRestartBuildModal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title">Run Dockerfile Build?</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
Are you sure you want to run this Dockerfile build again? The results will be immediately pushed to the repository.
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" ng-click="restartBuild(currentBuild)">Run Build</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
|
||||
</div>
|
||||
|
|
Reference in a new issue