@Override public RemoteAction connectCommand( LocalServiceProvider serviceProvider, DeploymentDetails deploymentDetails, SpinnakerRuntimeSettings runtimeSettings, List<SpinnakerService.Type> serviceTypes) { RemoteAction result = new RemoteAction(); result.setScript(String.join("\n", "#!/usr/bin/env bash", "", "echo \"Spinnaker is installed locally on this machine - no work to do.\"")); return result; }
@Override public RemoteAction connectCommand( LocalServiceProvider serviceProvider, DeploymentDetails deploymentDetails, SpinnakerRuntimeSettings runtimeSettings, List<SpinnakerService.Type> serviceTypes) { RemoteAction result = new RemoteAction(); result.setScript(String.join("\n", "#!/usr/bin/env bash", "", "echo \"Spinnaker is installed locally on this machine - no work to do.\"")); 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; }
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"); } }
default void commitWrapperScripts() { Map<String, Object> bindings = new HashMap<>(); bindings.put("git-root", getGitRoot()); bindings.put("scripts-dir", getScriptsDir()); bindings.put("artifact", getArtifact().getName()); bindings.put("start-command", getStartCommand()); TemplatedResource scriptResource = new StringReplaceJarResource("/git/start.sh"); scriptResource.setBindings(bindings); String script = scriptResource.toString(); new RemoteAction() .setScript(script) .commitScript(Paths.get(getScriptsDir(), getArtifact().getName() + "-start.sh")); scriptResource = new StringReplaceJarResource("/git/stop.sh"); scriptResource.setBindings(bindings); script = scriptResource.toString(); new RemoteAction() .setScript(script) .commitScript(Paths.get(getScriptsDir(), getArtifact().getName() + "-stop.sh")); }
default void commitWrapperScripts() { Map<String, Object> bindings = new HashMap<>(); bindings.put("git-root", getGitRoot()); bindings.put("scripts-dir", getScriptsDir()); bindings.put("artifact", getArtifact().getName()); bindings.put("start-command", getStartCommand()); TemplatedResource scriptResource = new StringReplaceJarResource("/git/start.sh"); scriptResource.setBindings(bindings); String script = scriptResource.toString(); new RemoteAction() .setScript(script) .commitScript(Paths.get(getScriptsDir(), getArtifact().getName() + "-start.sh")); scriptResource = new StringReplaceJarResource("/git/stop.sh"); scriptResource.setBindings(bindings); script = scriptResource.toString(); new RemoteAction() .setScript(script) .commitScript(Paths.get(getScriptsDir(), getArtifact().getName() + "-stop.sh")); }
@Override public void commitWrapperScripts() { Map<String, Object> bindings = new HashMap<>(); bindings.put("git-root", getGitRoot()); bindings.put("scripts-dir", getScriptsDir()); bindings.put("artifact", getArtifact().getName()); bindings.put("start-command", getStartCommand()); TemplatedResource scriptResource = new StringReplaceJarResource("/git/deck-start.sh"); scriptResource.setBindings(bindings); String script = scriptResource.toString(); new RemoteAction() .setScript(script) .commitScript(Paths.get(getScriptsDir(), getArtifact().getName() + "-start.sh")); scriptResource = new StringReplaceJarResource("/git/stop.sh"); scriptResource.setBindings(bindings); script = scriptResource.toString(); new RemoteAction() .setScript(script) .commitScript(Paths.get(getScriptsDir(), getArtifact().getName() + "-stop.sh")); }
@Override public void commitWrapperScripts() { Map<String, Object> bindings = new HashMap<>(); bindings.put("git-root", getGitRoot()); bindings.put("scripts-dir", getScriptsDir()); bindings.put("artifact", getArtifact().getName()); bindings.put("start-command", getStartCommand()); TemplatedResource scriptResource = new StringReplaceJarResource("/git/deck-start.sh"); scriptResource.setBindings(bindings); String script = scriptResource.toString(); new RemoteAction() .setScript(script) .commitScript(Paths.get(getScriptsDir(), getArtifact().getName() + "-start.sh")); scriptResource = new StringReplaceJarResource("/git/stop.sh"); scriptResource.setBindings(bindings); script = scriptResource.toString(); new RemoteAction() .setScript(script) .commitScript(Paths.get(getScriptsDir(), getArtifact().getName() + "-stop.sh")); } }
@Override public RemoteAction clean(AccountDeploymentDetails<KubernetesAccount> details, SpinnakerRuntimeSettings runtimeSettings) { KubernetesSharedServiceSettings kubernetesSharedServiceSettings = new KubernetesSharedServiceSettings(details.getDeploymentConfiguration()); KubernetesV1ProviderUtils.kubectlDeleteNamespaceCommand(DaemonTaskHandler.getJobExecutor(), details, kubernetesSharedServiceSettings.getDeployLocation()); return new RemoteAction(); } }
@Override public RemoteAction clean(AccountDeploymentDetails<KubernetesAccount> details, SpinnakerRuntimeSettings runtimeSettings) { KubernetesSharedServiceSettings kubernetesSharedServiceSettings = new KubernetesSharedServiceSettings(details.getDeploymentConfiguration()); KubernetesV1ProviderUtils.kubectlDeleteNamespaceCommand(DaemonTaskHandler.getJobExecutor(), details, kubernetesSharedServiceSettings.getDeployLocation()); return new RemoteAction(); } }
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; } }
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; } }
@Override public RemoteAction clean(AccountDeploymentDetails<KubernetesAccount> details, SpinnakerRuntimeSettings runtimeSettings) { DaemonTaskHandler.newStage("Invoking kubectl"); DaemonTaskHandler.message("Deleting all 'svc,deploy,secret' resources with label 'app=spin'..."); KubernetesSharedServiceSettings kubernetesSharedServiceSettings = new KubernetesSharedServiceSettings(details.getDeploymentConfiguration()); KubernetesV2Utils.deleteSpinnaker(details.getAccount(), kubernetesSharedServiceSettings.getDeployLocation()); return new RemoteAction(); }
@Override public RemoteAction clean(AccountDeploymentDetails<KubernetesAccount> details, SpinnakerRuntimeSettings runtimeSettings) { DaemonTaskHandler.newStage("Invoking kubectl"); DaemonTaskHandler.message("Deleting all 'svc,deploy,secret' resources with label 'app=spin'..."); KubernetesSharedServiceSettings kubernetesSharedServiceSettings = new KubernetesSharedServiceSettings(details.getDeploymentConfiguration()); new KubernetesV2Executor(DaemonTaskHandler.getJobExecutor(), details.getAccount()).deleteSpinnaker(kubernetesSharedServiceSettings.getDeployLocation()); return new RemoteAction(); }