forked from jenkinsci/gitlab-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request jenkinsci#404 from mmitche/build-comment-extensions
Add job dsl extensions for build status messages
- Loading branch information
Showing
3 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/main/java/org/jenkinsci/plugins/ghprb/jobdsl/GhprbBuildStatusContext.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.jenkinsci.plugins.ghprb.jobdsl; | ||
|
||
import javaposse.jobdsl.dsl.Context; | ||
import org.jenkinsci.plugins.ghprb.extensions.comments.GhprbBuildResultMessage; | ||
import org.kohsuke.github.GHCommitState; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
class GhprbBuildStatusContext implements Context { | ||
List<GhprbBuildResultMessage> completedStatus = new ArrayList<GhprbBuildResultMessage>(); | ||
|
||
/** | ||
* Use a custom status for when a build is completed. Can be called multiple times to set messages for different | ||
* build results. Valid build results are {@code 'SUCCESS'}, {@code 'FAILURE'}, and {@code 'ERROR'}. | ||
*/ | ||
void completedStatus(String buildResult, String message) { | ||
completedStatus.add(new GhprbBuildResultMessage( | ||
GHCommitState.valueOf(buildResult), | ||
message | ||
)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters