protected static String stripSlashesAndGit(String path) { path = Strings.stripPrefix(path, "/"); path = Strings.stripPrefix(path, "/"); path = Strings.stripSuffix(path, "/"); path = Strings.stripSuffix(path, ".git"); return path; }
protected static String stripSlashesAndGit(String path) { path = Strings.stripPrefix(path, "/"); path = Strings.stripPrefix(path, "/"); path = Strings.stripSuffix(path, "/"); path = Strings.stripSuffix(path, ".git"); return path; }
String path = Strings.stripPrefix(gitUrl, prefix); path = stripSlashesAndGit(path); String[] paths = path.split(":|/", 3);
String path = Strings.stripPrefix(gitUrl, prefix); path = stripSlashesAndGit(path); String[] paths = path.split(":|/", 3);
try { String relativePath = Files.getRelativePath(dir, file); String value = Strings.stripPrefix(relativePath, "/"); String label = value; String postfix = "/" + JENKINSFILE;
public static Route createRouteForService(String routeDomainPostfix, String namespace, Service service, Logger log) { Route route = null; String id = KubernetesHelper.getName(service); if (Strings.isNotBlank(id) && shouldCreateRouteForService(log, service, id)) { route = new Route(); String routeId = id; KubernetesHelper.setName(route, namespace, routeId); RouteSpec routeSpec = new RouteSpec(); RouteTargetReference objectRef = new RouteTargetReferenceBuilder().withName(id).build(); //objectRef.setNamespace(namespace); routeSpec.setTo(objectRef); if (Strings.isNotBlank(routeDomainPostfix)) { // Let Openshift determine the route host when the domain is not set String host = Strings.stripSuffix(Strings.stripSuffix(id, "-service"), "."); String namespaceSuffix = "-" + namespace; routeSpec.setHost(host + namespaceSuffix + "." + Strings.stripPrefix(routeDomainPostfix, ".")); } route.setSpec(routeSpec); String json = null; try { json = KubernetesHelper.toJson(route); } catch (JsonProcessingException e) { json = e.getMessage() + ". object: " + route; } } return route; }
String redirectUri = "http://" + name + namespaceSuffix; if (Strings.isNotBlank(routeDomain)) { redirectUri += "." + Strings.stripPrefix(routeDomain, ".");