Search in sources :

Example 1 with LocalService

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;
}
Also used : RedisService(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.RedisService) HalException(com.netflix.spinnaker.halyard.core.error.v1.HalException) HashMap(java.util.HashMap) GenerateService(com.netflix.spinnaker.halyard.deploy.services.v1.GenerateService) SpinnakerRuntimeSettings(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.SpinnakerRuntimeSettings) Collectors(java.util.stream.Collectors) LocalService(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.local.LocalService) ClouddriverService(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.ClouddriverService) Slf4j(lombok.extern.slf4j.Slf4j) Component(org.springframework.stereotype.Component) List(java.util.List) LocalServiceProvider(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.local.LocalServiceProvider) Jedis(redis.clients.jedis.Jedis) Map(java.util.Map) Problem(com.netflix.spinnaker.halyard.core.problem.v1.Problem) RemoteAction(com.netflix.spinnaker.halyard.core.RemoteAction) SpinnakerService(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.SpinnakerService) RemoteAction(com.netflix.spinnaker.halyard.core.RemoteAction) LocalService(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.local.LocalService)

Aggregations

RemoteAction (com.netflix.spinnaker.halyard.core.RemoteAction)1 HalException (com.netflix.spinnaker.halyard.core.error.v1.HalException)1 Problem (com.netflix.spinnaker.halyard.core.problem.v1.Problem)1 GenerateService (com.netflix.spinnaker.halyard.deploy.services.v1.GenerateService)1 SpinnakerRuntimeSettings (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.SpinnakerRuntimeSettings)1 ClouddriverService (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.ClouddriverService)1 RedisService (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.RedisService)1 SpinnakerService (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.SpinnakerService)1 LocalService (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.local.LocalService)1 LocalServiceProvider (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.local.LocalServiceProvider)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 Collectors (java.util.stream.Collectors)1 Slf4j (lombok.extern.slf4j.Slf4j)1 Component (org.springframework.stereotype.Component)1 Jedis (redis.clients.jedis.Jedis)1