From eb1abb2e2cd94f6a6fd7965184b7cfde16328224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20M=C3=BCller?= Date: Thu, 28 Apr 2016 19:39:28 +0200 Subject: [PATCH] Add workflow step that updates the GitLab commit status depending on the build status (fixes #262) --- README.md | 6 + pom.xml | 7 +- .../GitLabCommitStatusPublisher.java | 90 +-------------- .../util/CommitStatusUpdater.java | 109 ++++++++++++++++++ .../workflow/GitLabCommitStatusStep.java | 104 +++++++++++++++++ 5 files changed, 230 insertions(+), 86 deletions(-) create mode 100644 src/main/java/com/dabsquared/gitlabjenkins/util/CommitStatusUpdater.java create mode 100644 src/main/java/com/dabsquared/gitlabjenkins/workflow/GitLabCommitStatusStep.java diff --git a/README.md b/README.md index 66654d9..ebe0e27 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,12 @@ If you plan to use forked repositories, you will need to enable the GitLab CI in **Note:** You do not need to select any "Trigger Events" as the Web Hook for Merge Request Events will alert Jenkins. * GitLab 8.1 has implemented a commit status api. To enable add the post-build step ``Publish build status to GitLab commit (GitLab 8.1+ required)`` to the job. + For pipeline jobs surround your build step with the gitlabCommitStatus step like this: + ``` + gitlabCommitStatus { +