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"); } }
public void assumeMetadata(Profile other) { requiredFiles = other.getRequiredFiles(); executable = other.isExecutable(); user = other.getUser(); env = other.getEnv(); } }
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"); } }
public void assumeMetadata(Profile other) { requiredFiles = other.getRequiredFiles(); executable = other.isExecutable(); user = other.getUser(); env = other.getEnv(); } }
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"); } }