/** * @deprecated Use {@link #addFor(hudson.model.Run)} */ @Deprecated public synchronized void add(@Nonnull AbstractBuild b) throws IOException { addFor((Run) b); }
private void record(Run<?,?> build, FilePath ws, TaskListener listener, Map<String,String> record, final String targets) throws IOException, InterruptedException { for (Record r : ws.act(new FindRecords(targets, build.getTimeInMillis()))) { Fingerprint fp = r.addRecord(build); if(fp==null) { listener.error(Messages.Fingerprinter_FailedFor(r.relativePath)); continue; } fp.addFor(build); record.put(r.relativePath,fp.getHashString()); } }
/** * @deprecated Use {@link #addFor(hudson.model.Run)} */ @Deprecated public synchronized void add(@Nonnull AbstractBuild b) throws IOException { addFor((Run) b); }
/** * Track the usage of credentials in a specific build. * * @param build the run to tag the fingerprint * @param credentials the credentials to fingerprint. * @param <C> the credentials type. * @return the supplied credentials for method chaining. * @since 2.1.1 */ @NonNull public static <C extends Credentials> List<C> trackAll(@NonNull Run build, @NonNull List<C> credentials) { for (Credentials c : credentials) { if (c != null) { try { getOrCreateFingerprintOf(c).addFor(build); } catch (IOException e) { LOGGER.log(Level.FINEST, "Could not track usage of " + c, e); } } } return credentials; }
/** * Track the usage of credentials in a specific build. * * @param build the run to tag the fingerprint * @param credentials the credentials to fingerprint. * @param <C> the credentials type. * @return the supplied credentials for method chaining. * @since 2.1.1 */ @NonNull public static <C extends Credentials> List<C> trackAll(@NonNull Run build, @NonNull List<C> credentials) { for (Credentials c : credentials) { if (c != null) { try { getOrCreateFingerprintOf(c).addFor(build); } catch (IOException e) { LOGGER.log(Level.FINEST, "Could not track usage of " + c, e); } } } return credentials; }
String artifactPathInFingerprintZone = artifactToFingerprint.getKey(); String artifactMd5 = artifactToFingerprint.getValue(); fingerprintMap.getOrCreate(null, artifactPathInFingerprintZone, artifactMd5).addFor(run);
String artifactPathInArchiveZone = artifactToFingerprint.getKey(); String artifactMd5 = artifactToFingerprint.getValue(); fingerprintMap.getOrCreate(run, artifactPathInArchiveZone, artifactMd5).addFor(run);
/** * Adds the current run to the fingerprint's usages. * * @param workspaceId the workspace's id * @throws IOException if fingerprint load operation fails, * or if no fingerprint is found for the given workspace id */ private void updateFingerprint(String workspaceId) throws IOException { Fingerprint f = Jenkins.getActiveInstance()._getFingerprint(workspaceId); if (f == null) { throw new AbortException("Couldn't find any Fingerprint for: " + workspaceId); } Fingerprint.RangeSet set = f.getUsages().get(run.getParent().getFullName()); if (set == null || !set.includes(run.getNumber())) { f.addFor(run); f.save(); } }
continue; fp.addFor(build); record.put(r.relativePath,fp.getHashString());