default String stageStartupScripts(DeploymentDetails details, GenerateService.ResolvedConfiguration resolvedConfiguration) { Map<String, Profile> profiles = resolvedConfiguration.getProfilesForService(getService().getType()); List<String> allCommands = new ArrayList<>(); for (Map.Entry<String, Profile> entry : profiles.entrySet()) { Profile profile = entry.getValue(); String source = profile.getStagedFile(getSpinnakerStagingPath(details.getDeploymentName())); String dest = profile.getOutputFile(); allCommands.add(String.format("mkdir -p $(dirname %s)", dest)); allCommands.add(String.format("cp -p %s %s", source, dest)); if (profile.isExecutable()) { allCommands.add(String.format("chmod +x %s", dest)); } } return Strings.join(allCommands, "\n"); }
default String stageStartupScripts(DeploymentDetails details, GenerateService.ResolvedConfiguration resolvedConfiguration) { Map<String, Profile> profiles = resolvedConfiguration.getProfilesForService(getService().getType()); List<String> allCommands = new ArrayList<>(); for (Map.Entry<String, Profile> entry : profiles.entrySet()) { Profile profile = entry.getValue(); String source = profile.getStagedFile(getSpinnakerStagingPath(details.getDeploymentName())); String dest = profile.getOutputFile(); allCommands.add(String.format("mkdir -p $(dirname %s)", dest)); allCommands.add(String.format("cp -p %s %s", source, dest)); if (profile.isExecutable()) { allCommands.add(String.format("chmod +x %s", dest)); } } return Strings.join(allCommands, "\n"); }
default String stageProfilesCommand(DeploymentDetails details, GenerateService.ResolvedConfiguration resolvedConfiguration) { Map<String, Profile> profiles = resolvedConfiguration.getProfilesForService(getService().getType()); List<String> allCommands = new ArrayList<>(); for (Map.Entry<String, Profile> entry : profiles.entrySet()) { Profile profile = entry.getValue(); String source = profile.getStagedFile(getSpinnakerStagingPath(details.getDeploymentName())); String dest = profile.getOutputFile(); allCommands.add(String.format("mkdir -p $(dirname %s)", dest)); allCommands.add(String.format("cp -p %s %s", source, dest)); if (profile.isExecutable()) { allCommands.add(String.format("chmod +x %s", dest)); } } return Strings.join(allCommands, "\n"); } }
default String stageProfilesCommand(DeploymentDetails details, GenerateService.ResolvedConfiguration resolvedConfiguration) { Map<String, Profile> profiles = resolvedConfiguration.getProfilesForService(getService().getType()); List<String> allCommands = new ArrayList<>(); for (Map.Entry<String, Profile> entry : profiles.entrySet()) { Profile profile = entry.getValue(); String source = profile.getStagedFile(getSpinnakerStagingPath(details.getDeploymentName())); String dest = profile.getOutputFile(); allCommands.add(String.format("mkdir -p $(dirname %s)", dest)); allCommands.add(String.format("cp -p %s %s", source, dest)); if (profile.isExecutable()) { allCommands.add(String.format("chmod +x %s", dest)); } } return Strings.join(allCommands, "\n"); } }
default String stageProfilesCommand(DeploymentDetails details, GenerateService.ResolvedConfiguration resolvedConfiguration) { Map<String, Profile> profiles = resolvedConfiguration.getProfilesForService(getService().getType()); List<String> allCommands = new ArrayList<>(); for (Map.Entry<String, Profile> entry : profiles.entrySet()) { Profile profile = entry.getValue(); String source = profile.getStagedFile(getSpinnakerStagingPath(details.getDeploymentName())); String dest = profile.getOutputFile(); String user = profile.getUser(); String group = profile.getGroup(); allCommands.add(String.format("mkdir -p $(dirname %s)", dest)); allCommands.add(String.format("cp -p %s %s", source, dest)); allCommands.add(String.format("chown %s:%s %s", user, group, dest)); allCommands.add(String.format("chmod 640 %s", dest)); for (String requiredFile : profile.getRequiredFiles()) { allCommands.add(String.format("chown %s:%s %s", user, group, requiredFile)); allCommands.add(String.format("chmod 640 %s", requiredFile)); } if (profile.isExecutable()) { allCommands.add(String.format("chmod +x %s", dest)); } } return Strings.join(allCommands, "\n"); } }
default String stageProfilesCommand(DeploymentDetails details, GenerateService.ResolvedConfiguration resolvedConfiguration) { Map<String, Profile> profiles = resolvedConfiguration.getProfilesForService(getService().getType()); List<String> allCommands = new ArrayList<>(); for (Map.Entry<String, Profile> entry : profiles.entrySet()) { Profile profile = entry.getValue(); String source = profile.getStagedFile(getSpinnakerStagingPath(details.getDeploymentName())); String dest = profile.getOutputFile(); String user = profile.getUser(); String group = profile.getGroup(); allCommands.add(String.format("mkdir -p $(dirname %s)", dest)); allCommands.add(String.format("cp -p %s %s", source, dest)); allCommands.add(String.format("chown %s:%s %s", user, group, dest)); allCommands.add(String.format("chmod 640 %s", dest)); for (String requiredFile : profile.getRequiredFiles()) { allCommands.add(String.format("chown %s:%s %s", user, group, requiredFile)); allCommands.add(String.format("chmod 640 %s", requiredFile)); } if (profile.isExecutable()) { allCommands.add(String.format("chmod +x %s", dest)); } } return Strings.join(allCommands, "\n"); } }
List<SecretMountPair> files = profilesInDirectory.stream() .map(p -> { File input = new File(p.getStagedFile(stagingPath)); File output = new File(p.getOutputFile()); return new SecretMountPair(input, output);
List<SecretMountPair> files = profilesInDirectory.stream() .map(p -> { File input = new File(p.getStagedFile(stagingPath)); File output = new File(p.getOutputFile()); return new SecretMountPair(input, output);
Path stagedFile = Paths.get(profile.getStagedFile(stagingPath)); VaultConfigMount vaultConfigMount = VaultConfigMount.fromLocalFile(stagedFile.toFile(), mountPoint); secretName = vaultService.writeVaultConfig(deploymentName, vault, secretName, vaultConfigMount); Path stagedFile = Paths.get(profile.getStagedFile(stagingPath)); VaultConfigMount vaultConfigMount = VaultConfigMount.fromLocalFile(stagedFile.toFile(), mountPoint); secretName = vaultService.writeVaultConfig(deploymentName, vault, secretName, vaultConfigMount);
Path stagedFile = Paths.get(profile.getStagedFile(stagingPath)); VaultConfigMount vaultConfigMount = VaultConfigMount.fromLocalFile(stagedFile.toFile(), mountPoint); secretName = vaultService.writeVaultConfig(deploymentName, vault, secretName, vaultConfigMount); Path stagedFile = Paths.get(profile.getStagedFile(stagingPath)); VaultConfigMount vaultConfigMount = VaultConfigMount.fromLocalFile(stagedFile.toFile(), mountPoint); secretName = vaultService.writeVaultConfig(deploymentName, vault, secretName, vaultConfigMount);