- Make sure to send the subdirectory when restarting a build
- Make sure to use the subdirectory to read the Dockerfile's location in a build package, and display the path - Nicer UI for showing the trigger description in the build view - Fix an NPE in the file change tree
This commit is contained in:
parent
3006b7b749
commit
89d9bcd894
8 changed files with 51 additions and 8 deletions
|
@ -2672,7 +2672,8 @@ quayApp.directive('triggerDescription', function () {
|
|||
transclude: false,
|
||||
restrict: 'C',
|
||||
scope: {
|
||||
'trigger': '=trigger'
|
||||
'trigger': '=trigger',
|
||||
'short': '=short'
|
||||
},
|
||||
controller: function($scope, $element) {
|
||||
}
|
||||
|
|
|
@ -818,9 +818,23 @@ function BuildPackageCtrl($scope, Restangular, ApiService, $routeParams, $rootSc
|
|||
// itself (should) be the Dockerfile.
|
||||
if (zipFiles && Object.keys(zipFiles).length) {
|
||||
// Load the dockerfile contents.
|
||||
var dockerfile = zip.file('Dockerfile');
|
||||
var dockerfilePath = 'Dockerfile';
|
||||
if ($scope.repobuild['job_config']) {
|
||||
var dockerfileFolder = ($scope.repobuild['job_config']['build_subdir'] || '');
|
||||
if (dockerfileFolder[0] == '/') {
|
||||
dockerfileFolder = dockerfileFolder.substr(1);
|
||||
}
|
||||
if (dockerfileFolder[dockerfileFolder.length - 1] == '/') {
|
||||
dockerfileFolder = dockerfileFolder.substr(0, dockerfileFolder.length - 1);
|
||||
}
|
||||
|
||||
dockerfilePath = dockerfileFolder + 'Dockerfile';
|
||||
}
|
||||
|
||||
var dockerfile = zip.file(dockerfilePath);
|
||||
if (dockerfile) {
|
||||
$scope.dockerFileContents = dockerfile.asText();
|
||||
$scope.dockerFilePath = dockerfilePath;
|
||||
}
|
||||
|
||||
// Build the zip file tree.
|
||||
|
@ -835,6 +849,7 @@ function BuildPackageCtrl($scope, Restangular, ApiService, $routeParams, $rootSc
|
|||
});
|
||||
} else {
|
||||
$scope.dockerFileContents = response;
|
||||
$scope.dockerFilePath = 'Dockerfile';
|
||||
}
|
||||
|
||||
$scope.loaded = true;
|
||||
|
@ -953,8 +968,14 @@ function RepoBuildCtrl($scope, Restangular, ApiService, $routeParams, $rootScope
|
|||
$scope.restartBuild = function(build) {
|
||||
$('#confirmRestartBuildModal').modal('hide');
|
||||
|
||||
var subdirectory = '';
|
||||
if (build['job_config']) {
|
||||
subdirectory = build['job_config']['build_subdir'] || '';
|
||||
}
|
||||
|
||||
var data = {
|
||||
'file_id': build['resource_key']
|
||||
'file_id': build['resource_key'],
|
||||
'subdirectory': subdirectory
|
||||
};
|
||||
|
||||
var params = {
|
||||
|
|
|
@ -851,7 +851,8 @@ function FileTreeBase() {
|
|||
* Calculates the dimensions of the tree.
|
||||
*/
|
||||
FileTreeBase.prototype.calculateDimensions_ = function(container) {
|
||||
var cw = document.getElementById(container).clientWidth;
|
||||
var containerElm = document.getElementById(container);
|
||||
var cw = containerElm ? containerElm.clientWidth : 1200;
|
||||
var barHeight = 20;
|
||||
var ch = (this.getNodesHeight() * barHeight) + 40;
|
||||
|
||||
|
|
Reference in a new issue