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"); } }
String mountPoint = Paths.get(profile.getOutputFile()).getParent().toString(); Set<Profile> profiles = collapseByDirectory.getOrDefault(mountPoint, new HashSet<>()); profiles.add(profile); return new ImmutablePair<>(new File(stagingPath, p.getName()), new File(p.getOutputFile()).getName()); }).collect(Collectors.toSet());
String mountPoint = Paths.get(profile.getOutputFile()).getParent().toString(); Set<Profile> profiles = collapseByDirectory.getOrDefault(mountPoint, new HashSet<>()); profiles.add(profile); return new ImmutablePair<>(new File(stagingPath, p.getName()), new File(p.getOutputFile()).getName()); }).collect(Collectors.toSet());
String outputFile = profile.getOutputFile(); String mountPoint = Paths.get(outputFile).getParent().toString(); .map(p -> { File input = new File(p.getStagedFile(stagingPath)); File output = new File(p.getOutputFile()); return new SecretMountPair(input, output); })
String outputFile = profile.getOutputFile(); String mountPoint = Paths.get(outputFile).getParent().toString(); .map(p -> { File input = new File(p.getStagedFile(stagingPath)); File output = new File(p.getOutputFile()); return new SecretMountPair(input, output); })
String mountPoint = Paths.get(profile.getOutputFile()).toString(); Path stagedFile = Paths.get(profile.getStagedFile(stagingPath)); VaultConfigMount vaultConfigMount = VaultConfigMount.fromLocalFile(stagedFile.toFile(), mountPoint); env.putAll(profile.getEnv()); String mountPoint = profile.getOutputFile(); String secretName = secretName("profile-" + profile.getName(), version); Path stagedFile = Paths.get(profile.getStagedFile(stagingPath));
String mountPoint = Paths.get(profile.getOutputFile()).toString(); Path stagedFile = Paths.get(profile.getStagedFile(stagingPath)); VaultConfigMount vaultConfigMount = VaultConfigMount.fromLocalFile(stagedFile.toFile(), mountPoint); env.putAll(profile.getEnv()); String mountPoint = profile.getOutputFile(); String secretName = secretName("profile-" + profile.getName(), version); Path stagedFile = Paths.get(profile.getStagedFile(stagingPath));