@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"); } }