package org.jenkinsci.plugins.p4.workflow; import hudson.Extension; import hudson.FilePath; import hudson.Launcher; import hudson.model.Run; import hudson.model.TaskListener; import hudson.util.ListBoxModel; import org.jenkinsci.plugins.p4.unshelve.UnshelveBuilder; import org.jenkinsci.plugins.p4.unshelve.UnshelveBuilderStep; import org.jenkinsci.plugins.workflow.steps.AbstractStepDescriptorImpl; import org.jenkinsci.plugins.workflow.steps.AbstractStepImpl; import org.jenkinsci.plugins.workflow.steps.AbstractSynchronousStepExecution; import org.jenkinsci.plugins.workflow.steps.StepContextParameter; import org.kohsuke.stapler.DataBoundConstructor; import javax.inject.Inject; public class P4UnshelveStep extends AbstractStepImpl { private final String shelf; private final String resolve; @DataBoundConstructor public P4UnshelveStep(String shelf, String resolve) { this.shelf = shelf; this.resolve = resolve; } public String getShelf() { return shelf; } public String getResolve() { return resolve; } @Extension(optional = true) public static final class DescriptorImpl extends AbstractStepDescriptorImpl { public DescriptorImpl() { super(P4UnshelveStepExecution.class); } @Override public String getFunctionName() { return "p4unshelve"; } @Override public String getDisplayName() { return "P4 Unshelve"; } public ListBoxModel doFillResolveItems() { return UnshelveBuilder.DescriptorImpl.doFillResolveItems(); } } public static class P4UnshelveStepExecution extends AbstractSynchronousStepExecution<Void> { private static final long serialVersionUID = 1L; @Inject private transient P4UnshelveStep step; @StepContextParameter private transient Run<?, ?> run; @StepContextParameter private transient FilePath workspace; @StepContextParameter private transient TaskListener listener; @StepContextParameter private transient Launcher launcher; @Override protected Void run() throws Exception { UnshelveBuilderStep unshelve = new UnshelveBuilderStep(step.getShelf(), step.getResolve()); unshelve.perform(run, workspace, launcher, listener); return null; } } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 23685 | Paul Allen | Copy main -> dev | ||
#1 | 20641 | Paul Allen | Copy main -> dev (jenkinsci/p4-plugin) | ||
//guest/perforce_software/p4jenkins/main/src/main/java/org/jenkinsci/plugins/p4/workflow/P4UnshelveStep.java | |||||
#2 | 20593 | Paul Allen |
Unshelve options in Pipeline. Update merge options and support unshelve ListBoxModel Option in Pipeline. |
||
#1 | 16529 | Paul Allen |
DSL for Unshelve task. DSL example: p4unshelve resolve: 'at', shelf: '10831' |