use of com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.local.LocalService in project halyard by spinnaker.
the class LocalDeployer method deploy.
@Override
public RemoteAction deploy(LocalServiceProvider serviceProvider, DeploymentDetails deploymentDetails, GenerateService.ResolvedConfiguration resolvedConfiguration, List<SpinnakerService.Type> serviceTypes) {
List<LocalService> enabledServices = serviceProvider.getLocalServices(serviceTypes).stream().filter(i -> resolvedConfiguration.getServiceSettings(i.getService()).getEnabled()).collect(Collectors.toList());
Map<String, String> installCommands = enabledServices.stream().filter(i -> !resolvedConfiguration.getServiceSettings(i.getService()).getSkipLifeCycleManagement()).reduce(new HashMap<>(), (commands, installable) -> {
String command = String.join("\n", installable.installArtifactCommand(deploymentDetails), installable.stageProfilesCommand(deploymentDetails, resolvedConfiguration));
commands.put(installable.getService().getCanonicalName(), command);
return commands;
}, (m1, m2) -> {
m1.putAll(m2);
return m1;
});
String installCommand = serviceProvider.getInstallCommand(deploymentDetails, resolvedConfiguration, installCommands);
RemoteAction result = new RemoteAction();
result.setAutoRun(true);
result.setScript(installCommand);
return result;
}
Aggregations