package org.jenkinsci.plugins.p4.workflow; import hudson.Extension; import hudson.FilePath; import hudson.Launcher; import hudson.model.Run; import hudson.model.TaskListener; import org.jenkinsci.Symbol; import org.jenkinsci.plugins.p4.tagging.TagNotifierStep; 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 P4TaggingStep extends AbstractStepImpl { private final String rawLabelName; private final String rawLabelDesc; @DataBoundConstructor public P4TaggingStep(String rawLabelName, String rawLabelDesc) { this.rawLabelName = rawLabelName; this.rawLabelDesc = rawLabelDesc; } public String getRawLabelName() { return rawLabelName; } public String getRawLabelDesc() { return rawLabelDesc; } @Extension(optional = true) @Symbol("label") public static final class DescriptorImpl extends AbstractStepDescriptorImpl { public DescriptorImpl() { super(P4TaggingStepExecution.class); } @Override public String getFunctionName() { return "p4tag"; } @Override public String getDisplayName() { return "P4 Tag"; } } public static class P4TaggingStepExecution extends AbstractSynchronousStepExecution<Void> { private static final long serialVersionUID = 1L; @Inject private transient P4TaggingStep 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 { TagNotifierStep notifier = new TagNotifierStep( step.getRawLabelName(), step.getRawLabelDesc(), false); notifier.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/P4TaggingStep.java | |||||
#2 | 15403 | Paul Allen |
Perforce triggered polling BETA. Perforce triggers on a change-submit and sends a POST to the endpoint http://${JENKINS}/p4/change with the data: {"change":"12345","p4port":"localhost:1666"} Note: ‘change’ is not used (yet), but ‘p4port’ MUST match the credential in the Jenkins Job. JENKINS-25249 |
||
#1 | 15394 | Paul Allen |
Workflow-DSL functionality. Tested workflow DSL against 1.596.1 older functionality tested against 1.580.1 @sven_erik_knop |
||
//guest/sven_erik_knop/p4jenkins/src/main/java/org/jenkinsci/plugins/p4/workflow/P4TaggingStep.java | |||||
#1 | 14133 | Sven Erik Knop | Added p4tag to the DSL part |