Search in sources :

Example 11 with DeploymentDetails

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");
}
Also used : DeploymentDetails(com.netflix.spinnaker.halyard.deploy.deployment.v1.DeploymentDetails) java.util(java.util) ArtifactSourcesConfig(com.netflix.spinnaker.halyard.config.config.v1.ArtifactSourcesConfig) Autowired(org.springframework.beans.factory.annotation.Autowired) ArtifactService(com.netflix.spinnaker.halyard.deploy.services.v1.ArtifactService) GenerateService(com.netflix.spinnaker.halyard.deploy.services.v1.GenerateService) SpinnakerRuntimeSettings(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.SpinnakerRuntimeSettings) Collectors(java.util.stream.Collectors) Component(org.springframework.stereotype.Component) LocalServiceProvider(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.local.LocalServiceProvider) StringReplaceJarResource(com.netflix.spinnaker.halyard.core.resource.v1.StringReplaceJarResource) RemoteAction(com.netflix.spinnaker.halyard.core.RemoteAction) BillOfMaterials(com.netflix.spinnaker.halyard.core.registry.v1.BillOfMaterials) SpinnakerService(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.SpinnakerService) Strings(io.fabric8.utils.Strings) TemplatedResource(com.netflix.spinnaker.halyard.core.resource.v1.TemplatedResource) StringReplaceJarResource(com.netflix.spinnaker.halyard.core.resource.v1.StringReplaceJarResource) TemplatedResource(com.netflix.spinnaker.halyard.core.resource.v1.TemplatedResource) RemoteAction(com.netflix.spinnaker.halyard.core.RemoteAction)

Example 12 with DeploymentDetails

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);
}
Also used : AccountDeploymentDetails(com.netflix.spinnaker.halyard.deploy.deployment.v1.AccountDeploymentDetails) DeploymentDetails(com.netflix.spinnaker.halyard.deploy.deployment.v1.DeploymentDetails) SpinnakerRuntimeSettings(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.SpinnakerRuntimeSettings) SpinnakerService(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.SpinnakerService) DeploymentConfiguration(com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration) Deployer(com.netflix.spinnaker.halyard.deploy.deployment.v1.Deployer) KubectlDeployer(com.netflix.spinnaker.halyard.deploy.deployment.v1.KubectlDeployer) DistributedDeployer(com.netflix.spinnaker.halyard.deploy.deployment.v1.DistributedDeployer) BakeDeployer(com.netflix.spinnaker.halyard.deploy.deployment.v1.BakeDeployer) LocalDeployer(com.netflix.spinnaker.halyard.deploy.deployment.v1.LocalDeployer) LocalGitDeployer(com.netflix.spinnaker.halyard.deploy.deployment.v1.LocalGitDeployer)

Aggregations

DeploymentDetails (com.netflix.spinnaker.halyard.deploy.deployment.v1.DeploymentDetails)12 SpinnakerService (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.SpinnakerService)10 SpinnakerRuntimeSettings (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.SpinnakerRuntimeSettings)9 RemoteAction (com.netflix.spinnaker.halyard.core.RemoteAction)8 DeploymentConfiguration (com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration)7 AccountDeploymentDetails (com.netflix.spinnaker.halyard.deploy.deployment.v1.AccountDeploymentDetails)7 BakeDeployer (com.netflix.spinnaker.halyard.deploy.deployment.v1.BakeDeployer)5 Deployer (com.netflix.spinnaker.halyard.deploy.deployment.v1.Deployer)5 DistributedDeployer (com.netflix.spinnaker.halyard.deploy.deployment.v1.DistributedDeployer)5 KubectlDeployer (com.netflix.spinnaker.halyard.deploy.deployment.v1.KubectlDeployer)5 LocalDeployer (com.netflix.spinnaker.halyard.deploy.deployment.v1.LocalDeployer)5 LocalGitDeployer (com.netflix.spinnaker.halyard.deploy.deployment.v1.LocalGitDeployer)5 Collectors (java.util.stream.Collectors)5 Autowired (org.springframework.beans.factory.annotation.Autowired)5 Component (org.springframework.stereotype.Component)5 BillOfMaterials (com.netflix.spinnaker.halyard.core.registry.v1.BillOfMaterials)4 StringReplaceJarResource (com.netflix.spinnaker.halyard.core.resource.v1.StringReplaceJarResource)4 TemplatedResource (com.netflix.spinnaker.halyard.core.resource.v1.TemplatedResource)4 ArtifactService (com.netflix.spinnaker.halyard.deploy.services.v1.ArtifactService)4 GenerateService (com.netflix.spinnaker.halyard.deploy.services.v1.GenerateService)4