use of com.netflix.spinnaker.halyard.deploy.deployment.v1.DeploymentDetails in project halyard by spinnaker.
the class LocalDebianServiceProvider method clean.
@Override
public RemoteAction clean(DeploymentDetails details, SpinnakerRuntimeSettings runtimeSettings) {
String uninstallArtifacts = String.join("\n", getServices().stream().filter(s -> s != null && runtimeSettings.getServiceSettings(s).getEnabled()).map(s -> ((LocalDebianService) s).uninstallArtifactCommand()).collect(Collectors.toList()));
Map<String, Object> bindings = new HashMap<>();
TemplatedResource resource = new StringReplaceJarResource("/debian/uninstall.sh");
bindings.put("uninstall-artifacts", uninstallArtifacts);
return new RemoteAction().setScript(resource.setBindings(bindings).toString()).setAutoRun(true).setScriptDescription("This script apt-get purges all spinnaker components & deletes their config");
}
use of com.netflix.spinnaker.halyard.deploy.deployment.v1.DeploymentDetails in project halyard by spinnaker.
the class DeployService method collectLogs.
public void collectLogs(String deploymentName, List<String> serviceNames) {
DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName);
SpinnakerServiceProvider<DeploymentDetails> serviceProvider = serviceProviderFactory.create(deploymentConfiguration);
SpinnakerRuntimeSettings runtimeSettings = serviceProvider.buildRuntimeSettings(deploymentConfiguration);
Deployer deployer = getDeployer(deploymentConfiguration);
DeploymentDetails deploymentDetails = getDeploymentDetails(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());
}
deployer.collectLogs(serviceProvider, deploymentDetails, runtimeSettings, serviceTypes);
}
Aggregations