default RemoteAction prep( S serviceProvider, D deploymentDetails, SpinnakerRuntimeSettings runtimeSettings, List<SpinnakerService.Type> serviceTypes ) { RemoteAction result = new RemoteAction(); result.setAutoRun(true); result.setScript(""); return result; }
default RemoteAction prep( S serviceProvider, D deploymentDetails, SpinnakerRuntimeSettings runtimeSettings, List<SpinnakerService.Type> serviceTypes ) { RemoteAction result = new RemoteAction(); result.setAutoRun(true); result.setScript(""); return result; } }
@Override public RemoteAction connectCommand(DistributedServiceProvider<T> serviceProvider, AccountDeploymentDetails<T> deploymentDetails, SpinnakerRuntimeSettings runtimeSettings, List<SpinnakerService.Type> serviceTypes) { RemoteAction result = new RemoteAction(); String connectCommands = String.join(" &\n", serviceTypes.stream() .map(t -> serviceProvider.getDeployableService(t) .connectCommand(deploymentDetails, runtimeSettings)) .collect(Collectors.toList())); result.setScript("#!/bin/bash\n" + connectCommands); result.setScriptDescription( "The generated script will open connections to the API & UI servers using ssh tunnels"); result.setAutoRun(false); return result; }
@Override public RemoteAction connectCommand(DistributedServiceProvider<T> serviceProvider, AccountDeploymentDetails<T> deploymentDetails, SpinnakerRuntimeSettings runtimeSettings, List<SpinnakerService.Type> serviceTypes) { RemoteAction result = new RemoteAction(); String connectCommands = String.join(" &\n", serviceTypes.stream() .map(t -> serviceProvider.getDeployableService(t) .connectCommand(deploymentDetails, runtimeSettings)) .collect(Collectors.toList())); result.setScript("#!/bin/bash\n" + connectCommands); result.setScriptDescription( "The generated script will open connections to the API & UI servers using ssh tunnels"); result.setAutoRun(false); return result; }
@Override public RemoteAction connectCommand(KubectlServiceProvider serviceProvider, AccountDeploymentDetails<KubernetesAccount> deploymentDetails, SpinnakerRuntimeSettings runtimeSettings, List<SpinnakerService.Type> serviceTypes) { RemoteAction result = new RemoteAction(); String connectCommands = String.join(" &\n", serviceTypes.stream() .map(t -> serviceProvider.getService(t) .connectCommand(deploymentDetails, runtimeSettings)) .collect(Collectors.toList())); result.setScript("#!/bin/bash\n" + connectCommands); result.setScriptDescription( "The generated script will open connections to the API & UI servers using ssh tunnels"); result.setAutoRun(false); return result; }
@Override public RemoteAction connectCommand(KubectlServiceProvider serviceProvider, AccountDeploymentDetails<KubernetesAccount> deploymentDetails, SpinnakerRuntimeSettings runtimeSettings, List<SpinnakerService.Type> serviceTypes) { RemoteAction result = new RemoteAction(); String connectCommands = String.join(" &\n", serviceTypes.stream() .map(t -> serviceProvider.getService(t) .connectCommand(deploymentDetails, runtimeSettings)) .collect(Collectors.toList())); result.setScript("#!/bin/bash\n" + connectCommands); result.setScriptDescription( "The generated script will open connections to the API & UI servers using ssh tunnels"); result.setAutoRun(false); return result; }
@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"); } }
@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"); } }
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; }
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; }
result.setAutoRun(true); result.setScript(installCommand); return result;
result.setAutoRun(true); result.setScript(installCommand); return result;
@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 -> { ServiceSettings serviceSettings = runtimeSettings.getServiceSettings(i.getService()); return serviceSettings != null && !serviceSettings.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; } }
@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 -> { ServiceSettings serviceSettings = runtimeSettings.getServiceSettings(i.getService()); return serviceSettings != null && !serviceSettings.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; } }
public RemoteAction install() { RemoteAction result = new RemoteAction(); String script = "#!/bin/bash\n" + "curl -LO https://storage.googleapis.com/spinnaker-artifacts/spin/$(curl -s https://storage.googleapis.com/spinnaker-artifacts/spin/latest)/linux/amd64/spin\n" + "chmod +x spin\n" + "sudo mv spin /usr/local/bin/spin"; result.setScript(script); result.setScriptDescription("The generated script will install the latest version of spin CLI"); result.setAutoRun(true); result.commitScript(halconfigDirectoryStructure.getSpinInstallScriptPath()); return result; } }
.getInstallCommand(deploymentDetails, resolvedConfiguration, installCommands); RemoteAction result = new RemoteAction(); result.setAutoRun(true); result.setScript(installCommand); return result;
public RemoteAction install() { RemoteAction result = new RemoteAction(); String script = "#!/bin/bash\n" + "curl -LO https://storage.googleapis.com/spinnaker-artifacts/spin/$(curl -s https://storage.googleapis.com/spinnaker-artifacts/spin/latest)/linux/amd64/spin\n" + "chmod +x spin\n" + "sudo mv spin /usr/local/bin/spin"; result.setScript(script); result.setScriptDescription("The generated script will install the latest version of spin CLI"); result.setAutoRun(true); result.commitScript(halconfigDirectoryStructure.getSpinInstallScriptPath()); return result; } }
.getInstallCommand(deploymentDetails, resolvedConfiguration, installCommands); RemoteAction result = new RemoteAction(); result.setAutoRun(true); result.setScript(installCommand); return result;