mirror of
https://github.com/portainer/portainer.git
synced 2025-08-08 07:15:23 +02:00
feat(image): upload local files for building image EE-3021 (#7507)
* support to make multiple files in archive buffer * upload files by multipart
This commit is contained in:
parent
a7d458f0bd
commit
d570aee554
6 changed files with 171 additions and 14 deletions
|
@ -13,6 +13,7 @@ function BuildImageController($scope, $async, $window, ModalService, BuildServic
|
|||
ImageNames: [{ Name: '', Valid: false, Unique: true }],
|
||||
UploadFile: null,
|
||||
DockerFileContent: '',
|
||||
AdditionalFiles: [],
|
||||
URL: '',
|
||||
Path: 'Dockerfile',
|
||||
NodeName: null,
|
||||
|
@ -74,7 +75,12 @@ function BuildImageController($scope, $async, $window, ModalService, BuildServic
|
|||
return BuildService.buildImageFromURL(names, URL, dockerfilePath);
|
||||
} else {
|
||||
var dockerfileContent = $scope.formValues.DockerFileContent;
|
||||
return BuildService.buildImageFromDockerfileContent(names, dockerfileContent);
|
||||
if ($scope.formValues.AdditionalFiles.length === 0) {
|
||||
return BuildService.buildImageFromDockerfileContent(names, dockerfileContent);
|
||||
} else {
|
||||
var additionalFiles = $scope.formValues.AdditionalFiles;
|
||||
return BuildService.buildImageFromDockerfileContentAndFiles(names, dockerfileContent, additionalFiles);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -140,4 +146,8 @@ function BuildImageController($scope, $async, $window, ModalService, BuildServic
|
|||
return ModalService.confirmWebEditorDiscard();
|
||||
}
|
||||
};
|
||||
|
||||
$scope.selectAdditionalFiles = function (files) {
|
||||
$scope.formValues.AdditionalFiles = files;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue