Refine search
/** * Checks if the specified expected location already contains the installed version of the tool. * * This check needs to run fairly efficiently. The current implementation uses the source URL of {@link Installable}, * based on the assumption that released bits do not change its content. */ protected boolean isUpToDate(FilePath expectedLocation, Installable i) throws IOException, InterruptedException { FilePath marker = expectedLocation.child(".installedFrom"); return marker.exists() && marker.readToString().equals(i.url); }
@Override public FilePath supplySettings(AbstractBuild<?, ?> build, TaskListener listener) { if (StringUtils.isEmpty(path)) { return null; } try { EnvVars env = build.getEnvironment(listener); String targetPath = Util.replaceMacro(this.path, build.getBuildVariableResolver()); targetPath = env.expand(targetPath); if (IOUtils.isAbsolute(targetPath)) { return new FilePath(new File(targetPath)); } else { FilePath mrSettings = build.getModuleRoot().child(targetPath); FilePath wsSettings = build.getWorkspace().child(targetPath); try { if (!wsSettings.exists() && mrSettings.exists()) { wsSettings = mrSettings; } } catch (Exception e) { throw new IllegalStateException("failed to find settings.xml at: " + wsSettings.getRemote()); } return wsSettings; } } catch (Exception e) { throw new IllegalStateException("failed to prepare global settings.xml"); } }
@Override public FilePath supplySettings(AbstractBuild<?, ?> build, TaskListener listener) { if (StringUtils.isEmpty(path)) { return null; } try { EnvVars env = build.getEnvironment(listener); String targetPath = Util.replaceMacro(this.path, build.getBuildVariableResolver()); targetPath = env.expand(targetPath); if (IOUtils.isAbsolute(targetPath)) { return new FilePath(new File(targetPath)); } else { FilePath mrSettings = build.getModuleRoot().child(targetPath); FilePath wsSettings = build.getWorkspace().child(targetPath); try { if (!wsSettings.exists() && mrSettings.exists()) { wsSettings = mrSettings; } } catch (Exception e) { throw new IllegalStateException("failed to find settings.xml at: " + wsSettings.getRemote()); } return wsSettings; } } catch (Exception e) { throw new IllegalStateException("failed to prepare settings.xml"); } }
private boolean installIfNecessaryFrom(@Nonnull URL archive, @CheckForNull TaskListener listener, @Nonnull String message, int maxRedirects) throws InterruptedException, IOException { try { FilePath timestamp = this.child(".timestamp"); long lastModified = timestamp.lastModified(); URLConnection con; if (this.exists()) { if(this.exists()) { if (lastModified != 0 && sourceTimestamp == lastModified) return false; // already up to date
/** * Checks if the specified expected location already contains the installed version of the tool. * * This check needs to run fairly efficiently. The current implementation uses the source URL of {@link Installable}, * based on the assumption that released bits do not change its content. */ protected boolean isUpToDate(FilePath expectedLocation, Installable i) throws IOException, InterruptedException { FilePath marker = expectedLocation.child(".installedFrom"); return marker.exists() && marker.readToString().equals(i.url); }
/** * Checks if the specified expected location already contains the installed * version of the tool. * * This check needs to run fairly efficiently. The current implementation * uses the souce URL of {@link Installable}, based on the assumption that * released bits do not change its content. */ protected boolean isUpToDate(FilePath expectedLocation, Installable i) throws IOException, InterruptedException { FilePath marker = expectedLocation.child(".installedFrom"); return marker.exists() && marker.readToString().equals(i.url); }
/** * Checks if the specified expected location already contains the installed version of the tool. * * This check needs to run fairly efficiently. The current implementation uses the souce URL of {@link Installable}, * based on the assumption that released bits do not change its content. */ protected boolean isUpToDate(FilePath expectedLocation, Installable i) throws IOException, InterruptedException { FilePath marker = expectedLocation.child(".installedFrom"); return marker.exists() && marker.readToString().equals(i.url); }
/** * Checks if the specified expected location already contains the installed version of the tool. * * This check needs to run fairly efficiently. The current implementation uses the souce URL of {@link Installable}, * based on the assumption that released bits do not change its content. */ protected boolean isUpToDate(FilePath expectedLocation, Installable i) throws IOException, InterruptedException { FilePath marker = expectedLocation.child(".installedFrom"); return marker.exists() && marker.readToString().equals(i.url); }
/** * Checks if the specified expected location already contains the installed version of the tool. * * This check needs to run fairly efficiently. The current implementation uses the souce URL of {@link Installable}, * based on the assumption that released bits do not change its content. */ protected boolean isUpToDate(FilePath expectedLocation, Installable i) throws IOException, InterruptedException { FilePath marker = expectedLocation.child(".installedFrom"); return marker.exists() && marker.readToString().equals(i.url); }
public static boolean areNpmPackagesUpToDate(FilePath expected, String npmPackages, long npmPackagesRefreshHours) throws IOException, InterruptedException { FilePath marker = expected.child(NPM_PACKAGES_RECORD_FILENAME); return marker.exists() && marker.readToString().equals(npmPackages) && System.currentTimeMillis() < marker.lastModified()+ TimeUnit.HOURS.toMillis(npmPackagesRefreshHours); }
public boolean hasGitModules() throws GitException { try { FilePath dotGit = workspace.child(".gitmodules"); return dotGit.exists(); } catch (SecurityException ex) { throw new GitException( "Security error when trying to check for .gitmodules. Are you sure you have correct permissions?", ex); } catch (Exception e) { throw new GitException("Couldn't check for .gitmodules", e); } }
public boolean hasGitRepo(String GIT_DIR) throws GitException { try { FilePath dotGit = workspace.child(GIT_DIR); return dotGit.exists(); } catch (SecurityException ex) { throw new GitException( "Security error when trying to check for .git. Are you sure you have correct permissions?", ex); } catch (Exception e) { throw new GitException("Couldn't check for .git", e); } }
public boolean hasGitModules() throws GitException { try { FilePath dotGit = workspace.child(".gitmodules"); return dotGit.exists(); } catch (SecurityException ex) { throw new GitException( "Security error when trying to check for .gitmodules. Are you sure you have correct permissions?", ex); } catch (Exception e) { throw new GitException("Couldn't check for .gitmodules", e); } }
private boolean copyHtmlReport(FilePath coverageReportDir, FilePath buildTarget, BuildListener listener) throws IOException, InterruptedException { // Copy the HTML coverage report final FilePath htmlIndexHtmlPath = coverageReportDir.child("index.html"); if (htmlIndexHtmlPath.exists()) { final FilePath htmlDirPath = htmlIndexHtmlPath.getParent(); listener.getLogger().println("Publishing Clover HTML report..."); htmlDirPath.copyRecursiveTo("**/*", buildTarget); return true; } return false; }