package org.jenkinsci.plugins.p4.publish; import hudson.FilePath; import hudson.Launcher; import hudson.model.Result; import hudson.model.Run; import hudson.model.TaskListener; import hudson.tasks.BuildStepMonitor; import jenkins.tasks.SimpleBuildStep; import org.jenkinsci.plugins.p4.tasks.PublishTask; import org.jenkinsci.plugins.p4.workspace.Workspace; import org.kohsuke.stapler.DataBoundConstructor; import java.io.IOException; public class PublishNotifierStep extends PublishNotifier implements SimpleBuildStep { @DataBoundConstructor public PublishNotifierStep(String credential, Workspace workspace, Publish publish) { super(credential, workspace, publish); } @Override public BuildStepMonitor getRequiredMonitorService() { return BuildStepMonitor.NONE; } @Override public void perform(Run<?, ?> run, FilePath buildWorkspace, Launcher launcher, TaskListener listener) throws InterruptedException, IOException { // return early if publish not required if (getPublish().isOnlyOnSuccess() && run.getResult() != Result.SUCCESS) { return; } Workspace ws = (Workspace) getWorkspace().clone(); // Create task PublishTask task = new PublishTask(getPublish()); task.setListener(listener); task.setCredential(getCredential(), run.getParent()); ws = task.setEnvironment(run, ws, buildWorkspace); task.setWorkspace(ws); // Expand description String desc = getPublish().getDescription(); desc = ws.getExpand().format(desc, false); getPublish().setExpandedDesc(desc); buildWorkspace.act(task); } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#8 | 29212 | Paul Allen |
Merge pull request #160 from pschlan/JENKINS-69808 JENKINS-69808: Cleanup client after publish, if enabled |
||
#7 | 24942 | Paul Allen |
Deep clone of Workspace objects. WorkspaceSpec was not cloned and caused the View to change. JENKINS-54695 |
||
#6 | 24487 | Paul Allen | Perforce Connection Refactor. | ||
#5 | 22894 | Paul Allen |
(minor) remove Pipeline Library after test. Clean up after testGlobalLib and minor refactor on PublishNotifier and PublishNotifierStep. |
||
#4 | 22021 | Paul Allen |
Set environment to expand client name for Publish and Remove Client. JENKINS-43378 |
||
#3 | 21794 | Paul Allen |
Merge pull request #39 from Dohbedoh/JENKINS-34825 Jenkins 34825 |
||
#2 | 19762 | Paul Allen | Missing Override annotations. | ||
#1 | 16510 | Paul Allen | Move AssetNotifier* to Publish and rename. | ||
//guest/perforce_software/p4jenkins/main/src/main/java/org/jenkinsci/plugins/p4/asset/AssetNotifierStep.java | |||||
#1 | 15394 | Paul Allen |
Workflow-DSL functionality. Tested workflow DSL against 1.596.1 older functionality tested against 1.580.1 @sven_erik_knop |