Search in sources :

Example 1 with LocalGitServiceProvider

use of com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.local.git.LocalGitServiceProvider in project halyard by spinnaker.

the class LocalGitDeployer method prep.

@Override
public RemoteAction prep(LocalServiceProvider serviceProvider, DeploymentDetails deploymentDetails, SpinnakerRuntimeSettings runtimeSettings, List<SpinnakerService.Type> serviceTypes) {
    LocalGitServiceProvider localGitServiceProvider = (LocalGitServiceProvider) serviceProvider;
    List<LocalGitService> enabledServices = localGitServiceProvider.getLocalGitServices(serviceTypes);
    List<String> prepCommands = enabledServices.stream().filter(i -> !runtimeSettings.getServiceSettings(i.getService()).getSkipLifeCycleManagement()).map(s -> {
        s.commitWrapperScripts();
        return s.prepArtifactCommand(deploymentDetails);
    }).collect(Collectors.toList());
    String prepCommand = localGitServiceProvider.getPrepCommand(deploymentDetails, prepCommands);
    RemoteAction result = new RemoteAction();
    result.setAutoRun(true);
    result.setScript(prepCommand);
    return result;
}
Also used : List(java.util.List) Slf4j(lombok.extern.slf4j.Slf4j) Component(org.springframework.stereotype.Component) LocalServiceProvider(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.local.LocalServiceProvider) LocalGitServiceProvider(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.local.git.LocalGitServiceProvider) LocalGitService(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.local.git.LocalGitService) SpinnakerRuntimeSettings(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.SpinnakerRuntimeSettings) RemoteAction(com.netflix.spinnaker.halyard.core.RemoteAction) SpinnakerService(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.SpinnakerService) Collectors(java.util.stream.Collectors) LocalGitServiceProvider(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.local.git.LocalGitServiceProvider) LocalGitService(com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.local.git.LocalGitService) RemoteAction(com.netflix.spinnaker.halyard.core.RemoteAction)

Aggregations

RemoteAction (com.netflix.spinnaker.halyard.core.RemoteAction)1 SpinnakerRuntimeSettings (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.SpinnakerRuntimeSettings)1 SpinnakerService (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.SpinnakerService)1 LocalServiceProvider (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.local.LocalServiceProvider)1 LocalGitService (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.local.git.LocalGitService)1 LocalGitServiceProvider (com.netflix.spinnaker.halyard.deploy.spinnaker.v1.service.local.git.LocalGitServiceProvider)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 Slf4j (lombok.extern.slf4j.Slf4j)1 Component (org.springframework.stereotype.Component)1