Skip to content
This repository has been archived by the owner on Sep 22, 2023. It is now read-only.

Commit

Permalink
Add SimpleBuild step and README for pipeline integration
Browse files Browse the repository at this point in the history
  • Loading branch information
poupounetjoyeux committed Mar 16, 2019
1 parent ee3935e commit a12e1c1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### ArtifactDeployer

This plug-in makes it possible to deploy artifacts from workspace to output directories.
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@
import hudson.tasks.Recorder;
import hudson.util.DescribableList;
import hudson.util.FormValidation;
import jenkins.tasks.SimpleBuildStep;
import org.jenkinsci.plugins.artifactdeployer.service.ArtifactDeployerCopy;
import org.jenkinsci.plugins.artifactdeployer.service.ArtifactDeployerManager;
import org.jenkinsci.plugins.artifactdeployer.service.DeployedArtifactsActionManager;
import org.kohsuke.stapler.AncestorInPath;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.QueryParameter;

import javax.annotation.Nonnull;
import java.io.IOException;
import java.io.Serializable;
import java.util.*;
Expand All @@ -52,7 +54,7 @@
/**
* @author Gregory Boissinot
*/
public class ArtifactDeployerPublisher extends Recorder implements MatrixAggregatable, Serializable {
public class ArtifactDeployerPublisher extends Recorder implements MatrixAggregatable, Serializable, SimpleBuildStep {

private List<ArtifactDeployerEntry> entries = Collections.emptyList();
private boolean deployEvenBuildFail;
Expand Down Expand Up @@ -259,6 +261,16 @@ public void setDeployEvenBuildFail(boolean deployEvenBuildFail) {
this.deployEvenBuildFail = deployEvenBuildFail;
}

@Override
public void perform(@Nonnull Run<?, ?> run, @Nonnull FilePath filePath, @Nonnull Launcher launcher, @Nonnull TaskListener taskListener) throws InterruptedException, IOException {
if(!(run instanceof AbstractBuild) || !(taskListener instanceof BuildListener))
{
return;
}

_perform((AbstractBuild)run, launcher, (BuildListener)taskListener);
}

@Extension
@SuppressWarnings("unused")
public static final class DeleteRemoteArtifact extends RunListener<AbstractBuild> {
Expand Down

0 comments on commit a12e1c1

Please sign in to comment.