Skip to content
This repository was archived by the owner on Nov 7, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class RemoteBuildConfiguration extends Builder {

private final boolean shouldNotFailBuild;
private final int pollInterval;
private final int connectionRetryLimit = 5;
private final int connectionRetryLimit;
private final boolean preventRemoteBuildQueue;
private final boolean blockBuildUntilComplete;
private final boolean enhancedLogging;
Expand All @@ -85,7 +85,7 @@ public class RemoteBuildConfiguration extends Builder {
@DataBoundConstructor
public RemoteBuildConfiguration(String remoteJenkinsName, boolean shouldNotFailBuild, String job, String token,
String parameters, boolean enhancedLogging, JSONObject overrideAuth, JSONObject loadParamsFromFile, boolean preventRemoteBuildQueue,
boolean blockBuildUntilComplete, int pollInterval) throws MalformedURLException {
boolean blockBuildUntilComplete, int pollInterval, int connectionRetryLimit) throws MalformedURLException {

this.token = token.trim();
this.remoteJenkinsName = remoteJenkinsName;
Expand All @@ -94,6 +94,7 @@ public RemoteBuildConfiguration(String remoteJenkinsName, boolean shouldNotFailB
this.preventRemoteBuildQueue = preventRemoteBuildQueue;
this.blockBuildUntilComplete = blockBuildUntilComplete;
this.pollInterval = pollInterval;
this.connectionRetryLimit = connectionRetryLimit;
this.enhancedLogging = enhancedLogging;

if (overrideAuth != null && overrideAuth.has("auth")) {
Expand Down Expand Up @@ -127,7 +128,7 @@ public RemoteBuildConfiguration(String remoteJenkinsName, boolean shouldNotFailB
}

public RemoteBuildConfiguration(String remoteJenkinsName, boolean shouldNotFailBuild,
boolean preventRemoteBuildQueue, boolean blockBuildUntilComplete, int pollInterval, String job,
boolean preventRemoteBuildQueue, boolean blockBuildUntilComplete, int pollInterval, int connectionRetryLimit, String job,
String token, String parameters, boolean enhancedLogging) throws MalformedURLException {

this.token = token.trim();
Expand All @@ -139,6 +140,7 @@ public RemoteBuildConfiguration(String remoteJenkinsName, boolean shouldNotFailB
this.preventRemoteBuildQueue = preventRemoteBuildQueue;
this.blockBuildUntilComplete = blockBuildUntilComplete;
this.pollInterval = pollInterval;
this.connectionRetryLimit = connectionRetryLimit;
this.overrideAuth = false;
this.auth.replaceBy(new Auth(null));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
<f:entry title="Poll Interval (seconds)" field="pollInterval">
<f:number clazz="positive-number" min="1" step="1" default="10" />
</f:entry>

<f:entry title="Maximum number of retries" field="connectionRetryLimit">
<f:number clazz="positive-number" min="0" step="1" default="5" />
</f:entry>

<f:entry title="Block until the remote triggered projects finish their builds." field="blockBuildUntilComplete">
<f:checkbox />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void testRemoteBuild() throws Exception {
FreeStyleProject project = jenkinsRule.createFreeStyleProject();
RemoteBuildConfiguration remoteBuildConfiguration = new RemoteBuildConfiguration(
remoteJenkinsServer.getDisplayName(), false, remoteProject.getFullName(), "",
"", true, null, null, false, true, 1);
"", true, null, null, false, true, 1, 5);
project.getBuildersList().add(remoteBuildConfiguration);

jenkinsRule.buildAndAssertSuccess(project);
Expand Down