mirror of
https://github.com/portainer/portainer.git
synced 2025-08-08 07:15:23 +02:00
feat(image-build): add the ability to build images (#1672)
This commit is contained in:
parent
e065bd4a47
commit
81de2a5afb
16 changed files with 607 additions and 15 deletions
|
@ -2,6 +2,8 @@ angular.module('portainer.app')
|
|||
.factory('CodeMirrorService', function CodeMirrorService() {
|
||||
'use strict';
|
||||
|
||||
var service = {};
|
||||
|
||||
var codeMirrorGenericOptions = {
|
||||
lineNumbers: true
|
||||
};
|
||||
|
@ -12,8 +14,6 @@ angular.module('portainer.app')
|
|||
lint: true
|
||||
};
|
||||
|
||||
var service = {};
|
||||
|
||||
service.applyCodeMirrorOnElement = function(element, yamlLint, readOnly) {
|
||||
var options = angular.copy(codeMirrorGenericOptions);
|
||||
|
||||
|
|
|
@ -8,6 +8,26 @@ angular.module('portainer.app')
|
|||
return Upload.upload({ url: url, data: { file: file }});
|
||||
}
|
||||
|
||||
service.buildImage = function(names, file, path) {
|
||||
var endpointID = EndpointProvider.endpointID();
|
||||
Upload.setDefaults({ ngfMinSize: 10 });
|
||||
return Upload.http({
|
||||
url: 'api/endpoints/' + endpointID + '/docker/build',
|
||||
headers : {
|
||||
'Content-Type': file.type
|
||||
},
|
||||
data: file,
|
||||
params: {
|
||||
t: names,
|
||||
dockerfile: path
|
||||
},
|
||||
ignoreLoadingBar: true,
|
||||
transformResponse: function(data, headers) {
|
||||
return jsonObjectsToArrayHandler(data);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
service.createStack = function(stackName, swarmId, file, env) {
|
||||
var endpointID = EndpointProvider.endpointID();
|
||||
return Upload.upload({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue