package org.jenkinsci.plugins.p4.workflow; import hudson.Extension; import hudson.scm.SCM; import java.util.logging.Logger; import org.jenkinsci.plugins.p4.PerforceScm; import org.jenkinsci.plugins.p4.browsers.P4WebBrowser; import org.jenkinsci.plugins.p4.populate.AutoCleanImpl; import org.jenkinsci.plugins.p4.populate.Populate; import org.jenkinsci.plugins.p4.workspace.StreamWorkspaceImpl; import org.jenkinsci.plugins.workflow.steps.scm.SCMStep; import org.kohsuke.stapler.DataBoundConstructor; public class P4Step extends SCMStep { private static Logger logger = Logger.getLogger(P4Step.class.getName()); private static final long serialVersionUID = 1L; private final String credentialsId; @DataBoundConstructor public P4Step(String credentialsId) { this.credentialsId = credentialsId; } @Override protected SCM createSCM() { logger.info("Create P4 SCM"); P4WebBrowser browser = null; String stream = "//stream/main"; String format = "jenkins-${node}-${project}.ws"; StreamWorkspaceImpl workspace = new StreamWorkspaceImpl("none", false, stream, format); Populate populate = new AutoCleanImpl(true, true, false, null); PerforceScm scm = new PerforceScm(credentialsId, workspace, null, populate, browser); return scm; } public String getCredentialsId() { return credentialsId; } @Extension(optional = true) public static final class DescriptorImpl extends SCMStepDescriptor { public DescriptorImpl() { // Fail now if dependency plugin not loaded. Descriptor.<init> will // actually fail anyway, but this is just to be sure. PerforceScm.class.hashCode(); } @Override public String getFunctionName() { return "p4"; } @Override public String getDisplayName() { return "P4"; } } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#7 | 15216 | Sven Erik Knop | Simple implementation of depot path for DSL | ||
#6 | 14133 | Sven Erik Knop | Added p4tag to the DSL part | ||
#5 | 14070 | Sven Erik Knop | Improved fill and check options | ||
#4 | 14052 | Sven Erik Knop | Fixed verification of source for P4: stream, template or path | ||
#3 | 14014 | Sven Erik Knop |
Single P4 Step works, but needs validation of fields for snippet generator |
||
#2 | 12959 | Sven Erik Knop |
Refactored p4 to p4_stream Connection selector works, stream autocomplete works workspace default name still missing |
||
#1 | 12958 | Sven Erik Knop |
DSL for P4 works in principle (hard coded workspace for now) Misses automatic loading of aggregator |