Skip to content

Commit

Permalink
Make parameters for sauceconnect pipeline step optional - JENKINS-41236
Browse files Browse the repository at this point in the history
  • Loading branch information
Gavin Mogan committed Jan 27, 2017
1 parent 1758bbd commit 18608f6
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions src/main/java/com/saucelabs/jenkins/pipeline/SauceConnectStep.java
Expand Up @@ -32,6 +32,7 @@
import org.jenkinsci.plugins.workflow.steps.StepContextParameter;
import org.kohsuke.stapler.AncestorInPath;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.DataBoundSetter;

import javax.annotation.Nonnull;
import java.util.ArrayList;
Expand All @@ -41,35 +42,60 @@
import static com.saucelabs.jenkins.pipeline.SauceConnectStep.SauceConnectStepExecution.getSauceTunnelManager;

public class SauceConnectStep extends AbstractStepImpl {
private final Boolean verboseLogging;
private final Boolean useGeneratedTunnelIdentifier;
private final String options;
private final String sauceConnectPath;
private Boolean verboseLogging = false;
private Boolean useGeneratedTunnelIdentifier = false;
private String options;
private String sauceConnectPath;

@DataBoundConstructor
public SauceConnectStep() {
}

public SauceConnectStep(String options, Boolean verboseLogging, Boolean useGeneratedTunnelIdentifier, String sauceConnectPath) {
this.verboseLogging = verboseLogging;
this.useGeneratedTunnelIdentifier = useGeneratedTunnelIdentifier;
this.sauceConnectPath = Util.fixEmptyAndTrim(sauceConnectPath);
this.options = StringUtils.trimToEmpty(options);
}


public String getOptions() {
return options;
}

@DataBoundSetter
public void setOptions(String options) {
this.options = options;
}

public String getSauceConnectPath() {
return sauceConnectPath;
}

@DataBoundSetter
public void setSauceConnectPath(String sauceConnectPath) {
this.sauceConnectPath = sauceConnectPath;
}

public Boolean getUseGeneratedTunnelIdentifier() {
return useGeneratedTunnelIdentifier;
}

@DataBoundSetter
public void setUseGeneratedTunnelIdentifier(Boolean useGeneratedTunnelIdentifier) {
this.useGeneratedTunnelIdentifier = useGeneratedTunnelIdentifier;
}

public Boolean getVerboseLogging() {
return verboseLogging;
}

@DataBoundSetter
public void setVerboseLogging(Boolean verboseLogging) {
this.verboseLogging = verboseLogging;
}


@Extension public static final class DescriptorImpl extends AbstractStepDescriptorImpl {
public DescriptorImpl() {
super(SauceConnectStepExecution.class);
Expand Down

0 comments on commit 18608f6

Please sign in to comment.