Skip to content

Commit

Permalink
Fix logback
Browse files Browse the repository at this point in the history
  • Loading branch information
reda-alaoui committed Sep 16, 2024
1 parent be06708 commit b922b34
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
maven-cd:
uses: jenkins-infra/github-reusable-workflows/.github/workflows/maven-cd.yml@v1
uses: jenkins-infra/github-reusable-workflows/.github/workflows/maven-cd.yml@v1.2.0
secrets:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_TOKEN: ${{ secrets.MAVEN_TOKEN }}
9 changes: 8 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
buildPlugin()
buildPlugin(
forkCount: '1C', // run this number of tests in parallel for faster feedback. If the number terminates with a 'C', the value will be multiplied by the number of available CPU cores
useContainerAgent: false, // Set to `false` if you need to use Docker for containerized tests
configurations: [
[platform: 'linux', jdk: 21],
[platform: 'windows', jdk: 17],
]
)
11 changes: 5 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.32</version>
<version>4.87</version>
<relativePath/>
</parent>

Expand All @@ -18,9 +18,8 @@
<changelist>999999-SNAPSHOT</changelist>
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
<!-- Baseline Jenkins version you use to build the plugin. Users must have this version or newer to run. -->
<jenkins.version>2.277.4</jenkins.version>
<java.level>8</java.level>
<jenkins-test-harness.version>1674.v3b8b1441e939</jenkins-test-harness.version>
<jenkins.version>2.361.4</jenkins.version>
<jenkins-test-harness.version>2225.2230.v6210cb_b_827f9</jenkins-test-harness.version>
<!-- Other properties you may want to use:
~ hpi-plugin.version: The HPI Maven Plugin version used by the plugin..
~ stapler-plugin.version: The Stapler Maven plugin version required by the plugin.
Expand All @@ -37,7 +36,7 @@

<git-code-format-maven-plugin.version>2.7</git-code-format-maven-plugin.version>
<assertj-core.version>3.21.0</assertj-core.version>
<logback-classic.version>1.2.3</logback-classic.version>
<logback-classic.version>1.5.8</logback-classic.version>
<sonar-ws-shaded.version>7.7.0</sonar-ws-shaded.version>
</properties>

Expand Down Expand Up @@ -66,7 +65,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.13</version>
<version>2.0.15</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
/** @author Réda Housni Alaoui */
public class LogbackConfigurator extends BasicConfigurator {

public void configure(LoggerContext lc) {
@Override
public ExecutionStatus configure(LoggerContext lc) {
super.configure(lc);
Level rootLevel =
Optional.ofNullable(System.getenv("SONAR_GERRIT_PLUGIN_TEST_LOG_ROOT_LEVEL"))
.map(Level::valueOf)
.orElse(Level.OFF);
lc.getLogger("ROOT").setLevel(rootLevel);
lc.getLogger("com.sonyericsson.hudson").setLevel(Level.WARN);
return ExecutionStatus.NEUTRAL;
}
}

0 comments on commit b922b34

Please sign in to comment.