Skip to content
Owen Mehegan edited this page Mar 7, 2017 · 3 revisions

Upgrade to version 1.4

Version 1.4 contains some changes that may require you to adapt your Pipeline jobs. FreeStyle and similar jobs aren't affected as for those the migration happens automatically during the upgrade. If you had configured some of the following options for the Build when a change is pushed to GitLab trigger of your Pipeline jobs you have to do the following:

Add note with build status on merge requests

This can now be done by the pipeline step addGitLabMRComment which takes the argument comment. To achieve the same behavior as before add this to your Pipeline job:

def resultIcon = currentBuild.result == 'SUCCESS' ? ':white_check_mark:' : ':anguished:'
addGitLabMRComment comment: "$resultIcon Jenkins Build $currentBuild.result\n\nResults available at: [Jenkins [$env.JOB_NAME#$env.BUILD_NUMBER]]($env.BUILD_URL)"

Note: You have to ensure that currentBuild.result is set to the correct value depending on your build.

Add vote with build status on merge requests

This can now be done by the pipeline step addGitLabMRComment which takes the argument comment. To achieve the same behavior as before add this to your Pipeline job:

addGitLabMRComment comment: currentBuild.result == 'SUCCESS' ? ':+1:' : ':-1:'

Note: You have to ensure that currentBuild.result is set to the correct value depending on your build.

Accept merge request on success

This can now be done by the pipeline step acceptGitLabMR. To achieve the same behavior as before add this to your Pipeline job:

if currentBuild.result == 'SUCCESS' {
    acceptGitLabMR()
}

Note: You have to ensure that currentBuild.result is set to the correct value depending on your build.