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;
}
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;
}
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;
}
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);
}
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);
}
Aggregations