use of com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.local.LocalServiceProvider 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;
}
use of com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.local.LocalServiceProvider in project halyard by spinnaker.
the class LocalGitDeployer method prep.
@Override
public RemoteAction prep(LocalServiceProvider serviceProvider, DeploymentDetails deploymentDetails, SpinnakerRuntimeSettings runtimeSettings, List<SpinnakerService.Type> serviceTypes) {
LocalGitServiceProvider localGitServiceProvider = (LocalGitServiceProvider) serviceProvider;
List<LocalGitService> enabledServices = localGitServiceProvider.getLocalGitServices(serviceTypes);
List<String> prepCommands = enabledServices.stream().filter(i -> !runtimeSettings.getServiceSettings(i.getService()).getSkipLifeCycleManagement()).map(s -> {
s.commitWrapperScripts();
return s.prepArtifactCommand(deploymentDetails);
}).collect(Collectors.toList());
String prepCommand = localGitServiceProvider.getPrepCommand(deploymentDetails, prepCommands);
RemoteAction result = new RemoteAction();
result.setAutoRun(true);
result.setScript(prepCommand);
return result;
}
Aggregations