package org.jenkinsci.plugins.p4.workspace; import hudson.DescriptorExtensionList; import hudson.ExtensionPoint; import hudson.model.Describable; import java.util.Map; import jenkins.model.Jenkins; import com.perforce.p4java.client.IClient; import com.perforce.p4java.server.IOptionsServer; public abstract class Workspace implements Cloneable, ExtensionPoint, Describable<Workspace> { private String charset; private boolean pinHost; private String rootPath; private String hostname; private Expand expand; public Workspace(String charset, boolean pinHost) { this.charset = charset; this.pinHost = pinHost; } public abstract WorkspaceType getType(); /** * Returns the client workspace name as defined in the configuration. This * may include ${tag} that have not been expanded. * * @return */ public abstract String getName(); public String getCharset() { return charset; } public boolean isPinHost() { return pinHost; } /** * Setup/Create a Perforce workspace for this mode. * * @param connection * @param user * @return Perforce client * @throws Exception */ public abstract IClient setClient(IOptionsServer connection, String user) throws Exception; public WorkspaceDescriptor getDescriptor() { return (WorkspaceDescriptor) Jenkins.getInstance().getDescriptor( getClass()); } public static DescriptorExtensionList<Workspace, WorkspaceDescriptor> all() { return Jenkins.getInstance() .<Workspace, WorkspaceDescriptor> getDescriptorList( Workspace.class); } public String getRootPath() { return rootPath; } public void setHostName(String hostname) { this.hostname = hostname; } public String getHostName() { return hostname; } public void setRootPath(String rootPath) { this.rootPath = rootPath; } public void setExpand(Map<String, String> map) { expand = new Expand(map); } public Expand getExpand() { return expand; } /** * Returns the fully expanded client workspace name. * * @return */ public String getFullName() { // expands Workspace name if formatters are used. String clientName = expand.format(getName(), false); // replace restricted characters with "-" as per the old plugin clientName = clientName.replaceAll(" ", "_"); clientName = clientName.replaceAll(",", "-"); clientName = clientName.replaceAll("=", "-"); clientName = clientName.replaceAll("/", "-"); return clientName; } public Object clone() { try { return super.clone(); } catch (CloneNotSupportedException e) { return null; } } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 13760 | Sven Erik Knop | merged changes from main | ||
#1 | 12955 | Sven Erik Knop | Branching using sknop.p4jenkins-main | ||
//guest/perforce_software/p4jenkins/main/src/main/java/org/jenkinsci/plugins/p4/workspace/Workspace.java | |||||
#8 | 12888 | Paul Allen |
Merged Pull#11 @rpocase [JENKINS-28213] Force syncing a workspace that does not exist on the filesystem causes a FileNotFoundException. - Tidy up imports and white space |
||
#7 | 11472 | Paul Allen |
Pin the Workspace to the build host. Added a check box under the Workspace configuration to allow Jenkins to Pin the workspace, by setting the Host field. The hostname is resolved from the Computer object or InetAddress. |
||
#6 | 10906 | Paul Allen |
Matrix Polling and Parent control - Polling for Matrix builds calculates changes based on children. - Parent build disabled when using "Matrix options for Perforce" in the Matrix Configuration (can be enabled by checking the “Build parent” box). - Parent Build now substitutes ${var} with ‘*’ for the workspace view. e.g. //depot/${os}/… //ws/${os}/… becomes… //depot/*/… //ws/*/… instead of… //depot/os/… //ws/os/… |
||
#5 | 10755 | Paul Allen |
Separate name space for 'label' parameter. Perforce Review endpoint added `label`, `change`, `status`, `pass`, and `fail` parameter into the environment, which is a shared name space. This clashed with the default `label` matrix name and causing users issues. The change prefixes the review parameters with `p4.` on addition to the environment. |
||
#4 | 9803 | Paul Allen | Merging using p4-jenkins | ||
#3 | 9769 | Paul Allen | Copying using p4-jenkins | ||
#2 | 9738 | Paul Allen | Merging using p4-jenkins | ||
#1 | 9690 | Paul Allen |
[Branching using p4-jenkins] Release 1.0.1 |
||
//guest/paul_allen/dev/p4-jenkins/p4-client/src/main/java/org/jenkinsci/plugins/p4/workspace/Workspace.java | |||||
#1 | 9672 | Paul Allen | Refactor name from 'p4_client' to 'p4'. | ||
//guest/paul_allen/dev/p4-jenkins/p4-client/src/main/java/org/jenkinsci/plugins/p4_client/workspace/Workspace.java | |||||
#7 | 9495 | Paul Allen |
Fix Polling issue; using the wrong client. Removed static classes and internal referenced to PerforceScm attributes, to avoid threading issues. |
||
#6 | 8902 | Paul Allen |
Updated test cases: Pushed Workspace 'charset' to abstract Workspace class. Minor bugfixes in Workspace AutoCompletionCandidates method. |
||
#5 | 8899 | Paul Allen | Move Workspace setup/creation code to Implementation class. | ||
#4 | 8738 | Paul Allen |
Workspace Name Formatter. For Template and Stream workspaces it allows the substitution of the following tags: ${node} The name given to the slave Jenkins node. ${hostname} The hostname for the slave Jenkins node. ${project} The name of the Jenkins build Job. ${hash} Unique hash code of the Jenkins node. |
||
#3 | 8663 | Paul Allen | Rollout of charset for all Workspace modes. | ||
#2 | 8641 | Paul Allen | Added workspace helper (setClient) and template/stream types. | ||
#1 | 8640 | Paul Allen |
Added Workspace and Singleton descriptor. Removed old connection code. |