package org.jenkinsci.plugins.p4.unshelve; import hudson.FilePath; import hudson.Launcher; import hudson.model.Run; import hudson.model.TaskListener; import jenkins.tasks.SimpleBuildStep; import org.jenkinsci.plugins.p4.tagging.TagAction; import org.jenkinsci.plugins.p4.workspace.Workspace; import java.io.IOException; public class UnshelveBuilderStep extends UnshelveBuilder implements SimpleBuildStep { private String credential; private Workspace workspace; public UnshelveBuilderStep(String credential, Workspace workspace, String shelf, String resolve, boolean tidy) { super(shelf, resolve, tidy); this.credential = credential; this.workspace = workspace; } @Deprecated public UnshelveBuilderStep(String shelf, String resolve) { super(shelf, resolve, false); } @Override public void perform(Run<?, ?> run, FilePath buildWorkspace, Launcher launcher, TaskListener listener) throws InterruptedException, IOException { TagAction tagAction = run.getAction(TagAction.class); credential = (credential == null) ? tagAction.getCredential() : credential; workspace = (workspace == null) ? tagAction.getWorkspace() : workspace; unshelve(run, credential, workspace, buildWorkspace, listener); } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#4 | 22858 | Paul Allen |
Merge pull request #54 from mihailogazda/master. P4Unshelve build step can now be skipped successfully if the changelist ID is not set. |
||
#3 | 22821 | Paul Allen |
Merge pull request #53 from jenkinsci/TagAction-order Get Last TagAction. JENKINS-37618 JENKINS-45613 |
||
#2 | 22315 | Paul Allen |
Pending change cleanup for unshelve. Unshelve would leave files open for add/edit/delete, the 'tidy' option will 'revert -k' the files leaving the content in the workspace, but removing the 'have' list data. Unshelve can now specify a Credential and Workspace, important for situations where more than one sync occurs in a pipeline script. JENKINS-43430 |
||
#1 | 16529 | Paul Allen |
DSL for Unshelve task. DSL example: p4unshelve resolve: 'at', shelf: '10831' |