1
0
Fork 0
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:
Anthony Lapenna 2018-02-28 07:19:06 +01:00 committed by GitHub
parent e065bd4a47
commit 81de2a5afb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 607 additions and 15 deletions

View file

@ -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);

View file

@ -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({