Skip to content

Commit

Permalink
Update example to match picture
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkEWaite committed Oct 8, 2024
1 parent 682e3e0 commit e238fc5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,11 @@ Suppose we have a parameterized build, which uses the string parameter *version*
The script below puts a short text indicating the value of this parameter next to successful and unstable builds.

```groovy
if(manager.build.result.isBetterOrEqualTo(hudson.model.Result.UNSTABLE)) {
manager.addShortText("v${manager.build.buildVariables.get('version')}")
def buildNumber = env.BUILD_ID as int
if (buildNumber % 2) {
unstable("Setting build to unstable, version parameter is ${params.version}")
} else {
echo "Not setting build to unstable, version parameter is ${params.version}"
}
```

Expand Down

0 comments on commit e238fc5

Please sign in to comment.