Search in sources :

Example 1 with Deployer

use of com.netflix.spinnaker.halyard.deploy.deployment.v1.Deployer in project halyard by spinnaker.

the class DeployService method deploy.

public RemoteAction deploy(String deploymentName, List<DeployOption> deployOptions, List<String> serviceNames) {
    DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName);
    SpinnakerServiceProvider<DeploymentDetails> serviceProvider = serviceProviderFactory.create(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());
    }
    ResolvedConfiguration resolvedConfiguration;
    if (deployOptions.contains(DeployOption.OMIT_CONFIG)) {
        resolvedConfiguration = generateService.generateConfig(deploymentName, Collections.emptyList());
    } else {
        resolvedConfiguration = generateService.generateConfig(deploymentName, serviceTypes);
    }
    Path serviceSettingsPath = halconfigDirectoryStructure.getServiceSettingsPath(deploymentName);
    configParser.atomicWrite(serviceSettingsPath, resolvedConfiguration.getRuntimeSettings());
    Path serviceProfilesPath = halconfigDirectoryStructure.getServiceProfilesPath(deploymentName);
    configParser.atomicWrite(serviceProfilesPath, resolvedConfiguration.getServiceProfiles());
    Deployer deployer = getDeployer(deploymentConfiguration);
    DeploymentDetails deploymentDetails = getDeploymentDetails(deploymentConfiguration);
    RemoteAction action = deployer.deploy(serviceProvider, deploymentDetails, resolvedConfiguration, serviceTypes);
    halconfigParser.backupConfig();
    if (deployOptions.contains(DeployOption.FLUSH_INFRASTRUCTURE_CACHES)) {
        deployer.flushInfrastructureCaches(serviceProvider, deploymentDetails, resolvedConfiguration.getRuntimeSettings());
    }
    if (!action.getScript().isEmpty()) {
        action.commitScript(halconfigDirectoryStructure.getInstallScriptPath(deploymentName));
    }
    return action;
}
Also used : AccountDeploymentDetails(com.netflix.spinnaker.halyard.deploy.deployment.v1.AccountDeploymentDetails) DeploymentDetails(com.netflix.spinnaker.halyard.deploy.deployment.v1.DeploymentDetails) Path(java.nio.file.Path) ResolvedConfiguration(com.netflix.spinnaker.halyard.deploy.services.v1.GenerateService.ResolvedConfiguration) RemoteAction(com.netflix.spinnaker.halyard.core.RemoteAction) 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)

Example 2 with Deployer

use of com.netflix.spinnaker.halyard.deploy.deployment.v1.Deployer in project halyard by spinnaker.

the class DeployService method connectCommand.

public RemoteAction connectCommand(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.add(SpinnakerService.Type.DECK);
        serviceTypes.add(SpinnakerService.Type.GATE);
    }
    RemoteAction result = deployer.connectCommand(serviceProvider, deploymentDetails, runtimeSettings, serviceTypes);
    result.setAutoRun(true);
    result.commitScript(halconfigDirectoryStructure.getConnectScriptPath(deploymentName));
    return result;
}
Also used : AccountDeploymentDetails(com.netflix.spinnaker.halyard.deploy.deployment.v1.AccountDeploymentDetails) DeploymentDetails(com.netflix.spinnaker.halyard.deploy.deployment.v1.DeploymentDetails) RemoteAction(com.netflix.spinnaker.halyard.core.RemoteAction) 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)

Example 3 with Deployer

use of com.netflix.spinnaker.halyard.deploy.deployment.v1.Deployer in project halyard by spinnaker.

the class DeployService method prep.

public RemoteAction prep(String deploymentName, List<String> serviceNames) {
    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());
    }
    RemoteAction action = deployer.prep(serviceProvider, deploymentDetails, runtimeSettings, serviceTypes);
    if (!action.getScript().isEmpty()) {
        action.commitScript(halconfigDirectoryStructure.getPrepScriptPath(deploymentName));
    }
    return action;
}
Also used : AccountDeploymentDetails(com.netflix.spinnaker.halyard.deploy.deployment.v1.AccountDeploymentDetails) DeploymentDetails(com.netflix.spinnaker.halyard.deploy.deployment.v1.DeploymentDetails) RemoteAction(com.netflix.spinnaker.halyard.core.RemoteAction) 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)

Example 4 with Deployer

use of com.netflix.spinnaker.halyard.deploy.deployment.v1.Deployer in project halyard by spinnaker.

the class DeployService method rollback.

public void rollback(String deploymentName, List<String> serviceNames) {
    DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName);
    SpinnakerServiceProvider<DeploymentDetails> serviceProvider = serviceProviderFactory.create(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());
    }
    SpinnakerRuntimeSettings runtimeSettings = serviceProvider.buildRuntimeSettings(deploymentConfiguration);
    Deployer deployer = getDeployer(deploymentConfiguration);
    DeploymentDetails deploymentDetails = getDeploymentDetails(deploymentConfiguration);
    deployer.rollback(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)

Example 5 with Deployer

use of com.netflix.spinnaker.halyard.deploy.deployment.v1.Deployer 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

DeploymentConfiguration (com.netflix.spinnaker.halyard.config.model.v1.node.DeploymentConfiguration)5 AccountDeploymentDetails (com.netflix.spinnaker.halyard.deploy.deployment.v1.AccountDeploymentDetails)5 BakeDeployer (com.netflix.spinnaker.halyard.deploy.deployment.v1.BakeDeployer)5 Deployer (com.netflix.spinnaker.halyard.deploy.deployment.v1.Deployer)5 DeploymentDetails (com.netflix.spinnaker.halyard.deploy.deployment.v1.DeploymentDetails)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 SpinnakerService (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.SpinnakerService)5 SpinnakerRuntimeSettings (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.SpinnakerRuntimeSettings)4 RemoteAction (com.netflix.spinnaker.halyard.core.RemoteAction)3 ResolvedConfiguration (com.netflix.spinnaker.halyard.deploy.services.v1.GenerateService.ResolvedConfiguration)1 Path (java.nio.file.Path)1