Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade minimal Jenkins version to 2.303.1 #32

Merged
merged 3 commits into from
Dec 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
buildPlugin(useAci: true)
buildPlugin(useContainerAgent: true)
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@

# 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.
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
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:
Expand All @@ -31,9 +37,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 {
Expand All @@ -44,14 +52,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
```
9 changes: 5 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
Expand All @@ -13,7 +14,7 @@
<packaging>hpi</packaging>
<properties>
<changelist>999999-SNAPSHOT</changelist>
<jenkins.version>2.263.1</jenkins.version>
<jenkins.version>2.303.1</jenkins.version>
<java.level>8</java.level>
</properties>
<name>Build Discarder Plugin</name>
Expand All @@ -23,8 +24,8 @@
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.263.x</artifactId>
<version>937.v51fde92016ed</version>
<artifactId>bom-2.303.x</artifactId>
<version>1069.v4a8e43a79a40</version>
<scope>import</scope>
<type>pom</type>
</dependency>
Expand Down