Skip to content

Commit

Permalink
Fix the build
Browse files Browse the repository at this point in the history
  • Loading branch information
reda-alaoui committed Sep 16, 2024
1 parent be06708 commit 4c85cf3
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 28 deletions.
1 change: 1 addition & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
_extends: .github
tag-template: demo-$NEXT_MINOR_VERSION
15 changes: 0 additions & 15 deletions .github/workflows/cd.yaml

This file was deleted.

8 changes: 5 additions & 3 deletions .github/workflows/jenkins-security-scan.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: Jenkins Security Scan
# More information about the Jenkins security scan can be found at the developer docs: https://www.jenkins.io/redirect/jenkins-security-scan/

name: Jenkins Security Scan
on:
push:
branches:
- master
- "master"
- "main"
pull_request:
types: [ opened, synchronize, reopened ]
workflow_dispatch:
Expand All @@ -18,4 +20,4 @@ jobs:
uses: jenkins-infra/jenkins-security-scan/.github/workflows/jenkins-security-scan.yaml@v2
with:
java-cache: 'maven' # Optionally enable use of a build dependency cache. Specify 'maven' or 'gradle' as appropriate.
# java-version: 21 # Optionally specify what version of Java to set up for the build, or remove to use a recent default.
java-version: 11 # What version of Java to set up for the build.
17 changes: 17 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Automates creation of Release Drafts using Release Drafter
# More Info: https://github.com/jenkinsci/.github/blob/master/.github/release-drafter.adoc

on:
push:
branches:
- master
- main

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into the default branch
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 8 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
buildPlugin()
buildPlugin(
useContainerAgent: false, // Set to `false` if you need to use Docker for containerized tests
timeout: 180,
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;
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
package org.jenkinsci.plugins.sonargerrit.test_infrastructure.jenkins;

import java.nio.file.FileSystemException;
import org.junit.jupiter.api.extension.ExtensionContext;
import org.junit.platform.commons.util.AnnotationUtils;
import org.jvnet.hudson.test.JenkinsRecipe;
import org.jvnet.hudson.test.JenkinsRule;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/** @author Réda Housni Alaoui */
class JupiterJenkinsRule extends JenkinsRule implements ExtensionContext.Store.CloseableResource {

private static final Logger LOGGER = LoggerFactory.getLogger(JupiterJenkinsRule.class);
private final ExtensionContext context;

JupiterJenkinsRule(ExtensionContext context) {
Expand Down Expand Up @@ -35,6 +39,11 @@ public void recipe() throws Exception {

@Override
public void close() throws Throwable {
after();
try {
after();
} catch (FileSystemException e) {
// Can happen on Windows CI agent
LOGGER.warn(e.getMessage());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ private SonarqubeServer(Network network) {
.withDockerfileFromBuilder(
builder ->
builder
.from("docker.cosium.dev/sonarqube:8.9.2-community")
.from("sonarqube:8.9.2-community")
.add(
"https://github.com/mc1arke/sonarqube-community-branch-plugin/releases/download/1.8.1/sonarqube-community-branch-plugin-1.8.1.jar",
"/opt/sonarqube/extensions/plugins/sonarqube-community-branch-plugin.jar")))
Expand Down

0 comments on commit 4c85cf3

Please sign in to comment.