mirror of https://github.com/portainer/portainer
fix(templates): fix app templates stack deployment (#1747)
* fix(templates): fix app templates stack deployment * fix(templates): stack deployment remove return statement and fix identationpull/1755/head
parent
a72ffe4188
commit
bca8936faa
|
@ -108,19 +108,25 @@ function ($scope, $q, $state, $transition$, $anchorScroll, $filter, ContainerSer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
StackService.createStackFromGitRepository(stackName, template.Repository.url, template.Repository.stackfile, template.Env)
|
var repositoryOptions = {
|
||||||
.then(function success() {
|
RepositoryURL: template.Repository.url,
|
||||||
Notifications.success('Stack successfully created');
|
ComposeFilePathInRepository: template.Repository.stackfile
|
||||||
|
};
|
||||||
|
|
||||||
|
StackService.createStackFromGitRepository(stackName, repositoryOptions, template.Env)
|
||||||
|
.then(function success(data) {
|
||||||
|
Notifications.success('Stack successfully deployed');
|
||||||
|
ResourceControlService.applyResourceControl('stack', stackName, userId, accessControlData, [])
|
||||||
|
.then(function success() {
|
||||||
|
$state.go('docker.stacks');
|
||||||
|
})
|
||||||
|
.catch(function error(err) {
|
||||||
|
Notifications.error('Failure', err, 'Unable to apply resource control on the stack');
|
||||||
|
});
|
||||||
})
|
})
|
||||||
.catch(function error(err) {
|
.catch(function error(err) {
|
||||||
Notifications.warning('Deployment error', err.err.data.err);
|
Notifications.warning('Deployment error', err.err.data.err);
|
||||||
})
|
})
|
||||||
.then(function success(data) {
|
|
||||||
return ResourceControlService.applyResourceControl('stack', stackName, userId, accessControlData, []);
|
|
||||||
})
|
|
||||||
.then(function success() {
|
|
||||||
$state.go('docker.stacks', {}, {reload: true});
|
|
||||||
})
|
|
||||||
.finally(function final() {
|
.finally(function final() {
|
||||||
$scope.state.actionInProgress = false;
|
$scope.state.actionInProgress = false;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue