public CheckOutTask(AbstractBuild<?, ?> build, SubversionSCM scm, Date queueTime, Date buildTime, TaskListener listener) { this.authProvider = scm.getDescriptor().createAuthenticationProvider(build.getParent()); this.queueTime = queueTime; this.buildTime = buildTime; this.listener = listener; this.locations = scm.getLocations(build); this.revisionParameterAction = build.getAction(RevisionParameterAction.class); this.task = scm.getWorkspaceUpdater().createTask(); this.revisionPolicy = (scm.getDescriptor() != null ? scm.getDescriptor().getRevisionPolicy() : null); }
public CheckOutTask(AbstractBuild<?, ?> build, SubversionSCM scm, Date queueTime, Date buildTime, TaskListener listener) { this.authProvider = scm.getDescriptor().createAuthenticationProvider(build.getParent()); this.queueTime = queueTime; this.buildTime = buildTime; this.listener = listener; this.locations = scm.getLocations(build); this.revisionParameterAction = build.getAction(RevisionParameterAction.class); this.task = scm.getWorkspaceUpdater().createTask(); this.revisionPolicy = (scm.getDescriptor() != null ? scm.getDescriptor().getRevisionPolicy() : null); }
private String getExcludedRevpropNormalized() { String s = Util.fixEmptyAndTrim(getExcludedRevprop()); if (s != null) { return s; } return getDescriptor().getGlobalExcludedRevprop(); }
private String getExcludedRevpropNormalized() { String s = fixEmptyAndTrim(getExcludedRevprop()); if (s!=null) return s; return getDescriptor().getGlobalExcludedRevprop(); }
public BuildRevisionMapTask(AbstractBuild<?, ?> build, SubversionSCM parent, TaskListener listener, List<External> externals) { this.authProvider = parent.getDescriptor().createAuthenticationProvider(build.getParent()); this.listener = listener; this.externals = externals; this.locations = parent.getLocations(build); }
public BuildRevisionMapTask(AbstractBuild<?, ?> build, SubversionSCM parent, TaskListener listener, List<External> externals) { this.authProvider = parent.getDescriptor().createAuthenticationProvider(build.getParent()); this.listener = listener; this.externals = externals; this.locations = parent.getLocations(build); }
private String getExcludedRevpropNormalized() { String s = Util.fixEmptyAndTrim(getExcludedRevprop()); if (s != null) { return s; } return getDescriptor().getGlobalExcludedRevprop(); }
public boolean repositoryLocationsNoLongerExist(AbstractBuild<?, ?> build, TaskListener listener) { PrintStream out = listener.getLogger(); for (ModuleLocation l : getLocations(build)) { try { if (getDescriptor().checkRepositoryPath(build.getProject(), l.getSVNURL()) == SVNNodeKind.NONE) { out.println("Location '" + l.remote + "' does not exist"); ParametersAction params = build.getAction(ParametersAction.class); if (params != null) { // since this is used to disable projects, be conservative LOGGER.fine("Location could be expanded on build '" + build + "' parameters values:"); return false; } return true; } } catch (SVNException e) { // be conservative, since we are just trying to be helpful in detecting // non existent locations. If we can't detect that, we'll do nothing LOGGER.log(Level.FINE, "Location check failed", e); } } return false; }
public boolean repositoryLocationsNoLongerExist(AbstractBuild<?, ?> build, TaskListener listener) { PrintStream out = listener.getLogger(); for (ModuleLocation l : getLocations(build)) { try { if (getDescriptor().checkRepositoryPath(build.getProject(), l.getSVNURL()) == SVNNodeKind.NONE) { out.println("Location '" + l.remote + "' does not exist"); ParametersAction params = build.getAction(ParametersAction.class); if (params != null) { // since this is used to disable projects, be conservative LOGGER.fine("Location could be expanded on build '" + build + "' parameters values:"); return false; } return true; } } catch (SVNException e) { // be conservative, since we are just trying to be helpful in detecting // non existent locations. If we can't detect that, we'll do nothing LOGGER.log(Level.FINE, "Location check failed", e); } } return false; }
/** * @since 1.34 */ public boolean repositoryLocationsNoLongerExist(Run<?,?> build, TaskListener listener, EnvVars env) { PrintStream out = listener.getLogger(); for (ModuleLocation l : getLocations(env, build)) try { if (getDescriptor().checkRepositoryPath(build.getParent(), l.getSVNURL(), lookupCredentials(build.getParent(), l.credentialsId, l.getSVNURL())) == SVNNodeKind.NONE) { out.println("Location '" + l.remote + "' does not exist"); ParametersAction params = build.getAction(ParametersAction.class); if (params != null) { // since this is used to disable projects, be conservative LOGGER.fine("Location could be expanded on build '" + build + "' parameters values:"); return false; } return true; } } catch (SVNException e) { // be conservative, since we are just trying to be helpful in detecting // non existent locations. If we can't detect that, we'll do nothing LOGGER.log(FINE, "Location check failed",e); } return false; }
private ISVNAuthenticationProvider getSvnAuthenticationProvider(AbstractBuild<?, ?> build) { ISVNAuthenticationProvider sap; try { sap = getJenkinsScm().createAuthenticationProvider(build.getParent(), getLocation()); } catch (NoSuchMethodError e) { //fallback for versions under 2.x of org.jenkins-ci.plugins:subversion buildListener.getLogger().println( "[RELEASE] You are using an old subversion jenkins plugin, please consider upgrading."); sap = getJenkinsScm().getDescriptor().createAuthenticationProvider(build.getParent()); } if (sap == null) { throw new AbortException("Subversion authentication info is not set."); } return sap; }
final ISVNAuthenticationProvider authProvider = getDescriptor().createAuthenticationProvider(project); final ModuleLocation[] moduleLocations = getLocations(lastCompletedBuild);
final ISVNAuthenticationProvider authProvider = getDescriptor().createAuthenticationProvider(project);
@Issue("JENKINS-18099") @Test public void globalExclusionRevprop() throws Exception { SubversionSCM scm = new SubversionSCM( Arrays.asList(new SubversionSCM.ModuleLocation("file://some/repo", ".")), new UpdateUpdater(), null, null, null, null, null, null, false); scm.getDescriptor().setGlobalExcludedRevprop("ignoreme"); SVNProperties p = new SVNProperties(); p.put("ignoreme", "*"); Map<String, SVNLogEntryPath> paths = new HashMap<>(); paths.put("/foo", new SVNLogEntryPath("/foo", SVNLogEntryPath.TYPE_MODIFIED, null, -1)); SVNLogEntry e = new SVNLogEntry(paths, 1234L, p, false); SVNLogFilter filter = scm.createSVNLogFilter(); assertFalse(filter.isIncluded(e)); }