@Deprecated public ISVNAuthenticationProvider createAuthenticationProvider(Job<?, ?> inContextOf, ModuleLocation location) { return createAuthenticationProvider(inContextOf, location, TaskListener.NULL); }
public BuildRevisionMapTask(Run<?, ?> build, SubversionSCM parent, TaskListener listener, List<External> externals, EnvVars env) { this.listener = listener; this.externals = externals; this.locations = parent.getLocations(env, build); this.defaultAuthProvider = parent.createAuthenticationProvider(build.getParent(), null, listener); this.authProviders = new LinkedHashMap<String, ISVNAuthenticationProvider>(); for (ModuleLocation loc: locations) { authProviders.put(loc.remote, parent.createAuthenticationProvider(build.getParent(), loc, listener)); } }
CheckOutTask(Run<?, ?> build, SubversionSCM parent, ModuleLocation location, Date timestamp, TaskListener listener, EnvVars env, boolean quietOperation) { this.authProvider = parent.createAuthenticationProvider(build.getParent(), location, listener); this.timestamp = timestamp; this.listener = listener; this.location = location; this.revisions = build.getAction(RevisionParameterAction.class); this.task = parent.getWorkspaceUpdater().createTask(); this.quietOperation = quietOperation; }
private void commitToSVN(final AbstractBuild<?, ?> build, final Runner runner, SubversionSCM svn, String commitMessage) throws DebianizingException { try { for (String module: DebianPackageBuilder.getRemoteModules(build, runner)) { ISVNAuthenticationProvider authenticationProvider = svn.createAuthenticationProvider(build.getProject(), ChangesExtractor.findOurLocation(build, svn, runner, module)); SVNCommitHelper helper = new SVNCommitHelper(authenticationProvider, module, commitMessage); runner.announce("Commited revision <{0}> of <{2}> with message <{1}>", runner.getChannel().call(helper), commitMessage, module); } } catch (IOException e) { e.printStackTrace(); throw new DebianizingException("IOException: " + e.getMessage(), e); } catch (InterruptedException e) { e.printStackTrace(); throw new DebianizingException("Interrupted: " + e.getMessage(), e); } }
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; }
static List<Change> getChangesFromSubversion(@SuppressWarnings("rawtypes") AbstractBuild build, final Runner runner, SubversionSCM scm, final String remoteDebian, String latestRevision, String currentRevision, final String ourMessage) throws DebianizingException { final List<Change> result = new ArrayList<Change>(); ModuleLocation location = findOurLocation(build, scm, runner, remoteDebian); ISVNAuthenticationProvider authenticationProvider = ((SubversionSCM)build.getProject().getScm()).createAuthenticationProvider(build.getProject(), location); SvnClientManager manager = SubversionSCM.createClientManager(authenticationProvider); try { SVNURL svnurl = location.getSVNURL(); manager.getLogClient().doLog(svnurl, null, SVNRevision.UNDEFINED, SVNRevision.create(Long.parseLong(latestRevision) + 1), SVNRevision.parse(currentRevision), false, true, 0, new ISVNLogEntryHandler() { @Override public void handleLogEntry(SVNLogEntry logEntry) throws SVNException { if (!logEntry.getMessage().equals(ourMessage)) { result.add(new Change(logEntry.getAuthor(), logEntry.getMessage())); } } }); } catch (SVNException e) { e.printStackTrace(); throw new DebianizingException("SVNException: " + e.getMessage(), e); } finally { manager.dispose(); } return result; }
return BUILD_NOW; authProviders.put(url, createAuthenticationProvider(project, loc, listener)); final ISVNAuthenticationProvider defaultAuthProvider = createAuthenticationProvider(project, null, listener);