package org.jenkinsci.plugins.p4.tasks; import java.io.File; import java.io.IOException; import java.io.Serializable; import java.util.logging.Logger; import org.jenkinsci.plugins.p4.client.ClientHelper; import org.jenkinsci.plugins.p4.publish.Publish; import org.jenkinsci.remoting.RoleChecker; import org.jenkinsci.remoting.RoleSensitive; import hudson.FilePath.FileCallable; import hudson.remoting.VirtualChannel; import jenkins.security.Roles; public class PublishTask extends AbstractTask implements FileCallable<Boolean>, Serializable { private static final long serialVersionUID = 1L; private static Logger logger = Logger.getLogger(PublishTask.class.getName()); private final Publish publish; public PublishTask(Publish publish) { this.publish = publish; } public Boolean invoke(File workspace, VirtualChannel channel) throws IOException { return (Boolean) tryTask(); } @Override public Object task(ClientHelper p4) throws Exception { try { // Check connection (might be on remote slave) if (!checkConnection(p4)) { return false; } // Look for changes and add to change-list, then publish boolean open = p4.buildChange(publish); if (open) { p4.publishChange(publish); } } catch (Exception e) { p4.log("(p4):stop:exception\n"); String msg = "Unable to publish workspace: " + e; p4.log(msg); logger.warning(msg); return false; } finally { p4.disconnect(); } return true; } public void checkRoles(RoleChecker checker) throws SecurityException { checker.check((RoleSensitive) this, Roles.SLAVE); } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 20444 | vishal_trived | "Forking branch Main of p4-jenkins to vishal_trived-p4jenkins." | ||
//guest/perforce_software/p4jenkins/main/src/main/java/org/jenkinsci/plugins/p4/tasks/PublishTask.java | |||||
#9 | 19790 | Paul Allen |
Add a propagate delete option to Publish. Originally only add/edits were permitted to prevent users deleting files with incorrect View maps, but this option allows deletes if enabled. JENKINS-27885 |
||
#8 | 19431 | Paul Allen |
Raise failed submit as Exception and mark build as failed. JENKINS-34770 |
||
#7 | 16514 | Paul Allen |
Unshelve and resolve build step. Implements a classic Jenkins Build step (i.e. not Workflow). Must provide a shelf change number and resolve options. The shelf change number supports variable expansion ${VAR}. |
||
#6 | 15394 | Paul Allen |
Workflow-DSL functionality. Tested workflow DSL against 1.596.1 older functionality tested against 1.580.1 @sven_erik_knop |
||
#5 | 15293 | Paul Allen |
Add retry attempts to Perforce Tasks. If a task fails due to an exception then the task will retry based on the value specified in the connection Credential. |
||
#4 | 13604 | Paul Allen | Improved error handling and fixed test case issue. | ||
#3 | 12417 | Paul Allen |
Extend Jenkins support back to 1.568 - remove @Override annotations - remove jenkins.security.Roles |
||
#2 | 11626 | Paul Allen |
Workflow support. - Updated the plugin to the latest LTS Jenkins release 1.580.3. - Updated P4Java to 2014.1 Tested with simple ‘static’ workspace, there may be limitations with ‘manual’ workspace. Plan to add DSL support by extending the SCMStep class. #review-11537 JENKINS-24206 |
||
#1 | 11334 | Paul Allen |
Remote slave support for Publish Perforce Publish commands need to be executed from the remote slave. - Includes refactoring into task package |