public RemoteAction prep(String deploymentName, List<String> serviceNames, List<String> excludeServiceNames) { DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName); DeploymentDetails deploymentDetails = getDeploymentDetails(deploymentConfiguration); Deployer deployer = getDeployer(deploymentConfiguration); SpinnakerServiceProvider<DeploymentDetails> serviceProvider = serviceProviderFactory.create(deploymentConfiguration); SpinnakerRuntimeSettings runtimeSettings = serviceProvider.buildRuntimeSettings(deploymentConfiguration); List<SpinnakerService.Type> serviceTypes = serviceNames.stream() .map(SpinnakerService.Type::fromCanonicalName) .collect(Collectors.toList()); if (serviceTypes.isEmpty()) { serviceTypes = serviceProvider .getServices() .stream() .map(SpinnakerService::getType) .collect(Collectors.toList()); } if (!excludeServiceNames.isEmpty()) { serviceTypes = serviceTypes .stream() .filter(serviceType -> !excludeServiceNames.contains(serviceType.getCanonicalName())) .collect(Collectors.toList()); } RemoteAction action = deployer.prep(serviceProvider, deploymentDetails, runtimeSettings, serviceTypes); if (!action.getScript().isEmpty()) { action.commitScript(halconfigDirectoryStructure.getPrepScriptPath(deploymentName)); } return action; }
public RemoteAction prep(String deploymentName, List<String> serviceNames, List<String> excludeServiceNames) { DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName); DeploymentDetails deploymentDetails = getDeploymentDetails(deploymentConfiguration); Deployer deployer = getDeployer(deploymentConfiguration); SpinnakerServiceProvider<DeploymentDetails> serviceProvider = serviceProviderFactory.create(deploymentConfiguration); SpinnakerRuntimeSettings runtimeSettings = serviceProvider.buildRuntimeSettings(deploymentConfiguration); List<SpinnakerService.Type> serviceTypes = serviceNames.stream() .map(SpinnakerService.Type::fromCanonicalName) .collect(Collectors.toList()); if (serviceTypes.isEmpty()) { serviceTypes = serviceProvider .getServices() .stream() .map(SpinnakerService::getType) .collect(Collectors.toList()); } if (!excludeServiceNames.isEmpty()) { serviceTypes = serviceTypes .stream() .filter(serviceType -> !excludeServiceNames.contains(serviceType.getCanonicalName())) .collect(Collectors.toList()); } RemoteAction action = deployer.prep(serviceProvider, deploymentDetails, runtimeSettings, serviceTypes); if (!action.getScript().isEmpty()) { action.commitScript(halconfigDirectoryStructure.getPrepScriptPath(deploymentName)); } return action; }