From fbf97cac285c4ea887ea8b73acf438427dba7c7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96rjan=20Sj=C3=B6holm?= Date: Mon, 27 Dec 2021 10:49:13 +0100 Subject: [PATCH 1/3] Fix linting of readme --- README.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4b1abb5..6de748b 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,27 @@ # Jenkins Build Discarder Plugin + [![Github Build](https://github.com/jenkinsci/build-discarder-plugin/actions/workflows/cd.yaml/badge.svg?branch=main)](https://github.com/jenkinsci/build-discarder-plugin/actions/workflows/cd.yaml) [![Jenkins Build](https://ci.jenkins.io/job/Plugins/job/build-discarder-plugin/job/main/badge/icon)](https://ci.jenkins.io/job/Plugins/job/build-discarder-plugin/job/main/) [![Jenkins Plugin](https://img.shields.io/jenkins/plugin/v/build-discarder.svg)](https://plugins.jenkins.io/build-discarder) [![GitHub release](https://img.shields.io/github/release/jenkinsci/build-discarder-plugin.svg?label=changelog)](https://github.com/jenkinsci/build-discarder-plugin/releases/latest) ## Introduction + A global build discarder that's possible to override by adding a job specific discarder. The goal is to be able to have a global sensible default, that's possible to override if needed. ## Getting started -The `Default Build Discarder` can be added here: + +The `Default Build Discarder` can be added here: `Manage Jenkins >> Configure System >> Global Build Discarders` ![Alt text](docs/img/configure-default-discarder.png?raw=true "Title") ### Configuration as Code + Add `defaultBuildDiscarder` to your `configuredBuildDiscarders` with the standard `logRotator` settings. -``` + +```xml unclassified: buildDiscarders: configuredBuildDiscarders: @@ -31,9 +36,11 @@ unclassified: ``` ## Override the settings with a job specific discarder + Adding a [job specific discarder](https://stackoverflow.com/a/44155346) will make sure the `Default Build Discarder` is not applicable. -``` + +```groovy # Jenkinsfile pipeline { options { @@ -44,14 +51,18 @@ pipeline { ``` ## Background + The build in [Specific Build Discarder](https://github.com/jenkinsci/jenkins/blob/449c5aced523a6e66fe3d6a804e5dbfd5c5c67c6/core/src/main/java/jenkins/model/SimpleGlobalBuildDiscarderStrategy.java) discards build independent of specific job discarders. ## Contributing + See the default [contribution guidelines](https://github.com/jenkinsci/.github/blob/master/CONTRIBUTING.md) for Jenkins ### Local development + Start Jenkins by running this command -``` + +```bash mvn hpi:run ``` From 27b1e48bebcfb3be03cbc548107573ea218b3b7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96rjan=20Sj=C3=B6holm?= Date: Mon, 27 Dec 2021 13:28:12 +0100 Subject: [PATCH 2/3] Update bom and minimum Jenkins version to 2.303.1 --- README.md | 3 ++- pom.xml | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6de748b..c8d1412 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,8 @@ ## Introduction A global build discarder that's possible to override by adding a job -specific discarder. The goal is to be able to have a global sensible default, that's possible to override if needed. +specific discarder. The goal is to be able to have a global sensible default, that's possible to override if needed. The minimum supported version of Jenkins is `2.303.1`, the goal is to support +the two latest versions of Jenkins LTS. ## Getting started diff --git a/pom.xml b/pom.xml index 95772f2..55b6c23 100644 --- a/pom.xml +++ b/pom.xml @@ -1,5 +1,6 @@ - + 4.0.0 org.jenkins-ci.plugins @@ -13,7 +14,7 @@ hpi 999999-SNAPSHOT - 2.263.1 + 2.303.1 8 Build Discarder Plugin @@ -23,8 +24,8 @@ io.jenkins.tools.bom - bom-2.263.x - 937.v51fde92016ed + bom-2.303.x + 1069.v4a8e43a79a40 import pom From 4ff63197527e3a88f84e06c437c49b8bbdb8e4ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96rjan=20Sj=C3=B6holm?= Date: Mon, 27 Dec 2021 14:08:49 +0100 Subject: [PATCH 3/3] Use useContainerAgent useAci is deprecated and is being replaced by useContainerAgent https://issues.jenkins.io/browse/INFRA-2918 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 39b42fc..34ad4d6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1 +1 @@ -buildPlugin(useAci: true) +buildPlugin(useContainerAgent: true)