Skip to content

Commit

Permalink
JENKINS-30011 Allow multiple instances of Post Build Scripts as a pos…
Browse files Browse the repository at this point in the history
…t build action
  • Loading branch information
Daniel Heid authored and Daniel Heid committed Nov 3, 2017
1 parent 9440ba4 commit 18e7d7c
Show file tree
Hide file tree
Showing 9 changed files with 230 additions and 202 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -69,7 +69,7 @@
<artifactId>maven-hpi-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<compatibleSinceVersion>0.18</compatibleSinceVersion>
<compatibleSinceVersion>0.19</compatibleSinceVersion>
</configuration>
</plugin>
</plugins>
Expand Down
Expand Up @@ -5,12 +5,13 @@
/**
* @author Gregory Boissinot
*/
public class GenericScript {
public class GenericScript extends PostBuildItem {

private final String filePath;

@DataBoundConstructor
public GenericScript(String filePath) {
public GenericScript(String filePath, String result) {
super(result);
this.filePath = filePath;
}

Expand Down

This file was deleted.

Expand Up @@ -6,12 +6,13 @@
/**
* @author Gregory Boissinot
*/
public class GroovyScriptContent {
public class GroovyScriptContent extends PostBuildItem {

private final String content;

@DataBoundConstructor
public GroovyScriptContent(String content) {
public GroovyScriptContent(String content, String result) {
super(result);
this.content = Util.fixEmpty(content);
}

Expand Down
Expand Up @@ -6,12 +6,13 @@
/**
* @author Gregory Boissinot
*/
public class GroovyScriptFile {
public class GroovyScriptFile extends PostBuildItem {

private final String filePath;

@DataBoundConstructor
public GroovyScriptFile(String filePath) {
public GroovyScriptFile(String filePath, String result) {
super(result);
this.filePath = Util.fixEmpty(filePath);
}

Expand Down
@@ -0,0 +1,22 @@
package org.jenkinsci.plugins.postbuildscript;

import hudson.model.Result;


public class PostBuildItem {

private Result result;

public PostBuildItem(String result) {
this.result = Result.fromString(result);
}

public Result getTargetResult() {
return result;
}

public String getResult() {
return result.toString();
}

}

0 comments on commit 18e7d7c

Please sign in to comment.