diff --git a/README.md b/README.md index 39f8635bd..7aa994069 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Also you may install optional plugins. Be carefull, some of them are not support - sonar-xanitizer-plugin-2.2.0 - sonar-build-breaker-plugin-2.3.1.347 - sonar-issueresolver-plugin-1.0.2 - - sonarqube-community-branch-plugin-1.8.0 + - sonarqube-community-branch-plugin-1.8.1 See plugin matrix here: https://docs.sonarqube.org/latest/instance-administration/plugin-version-matrix/ diff --git a/defaults/main.yml b/defaults/main.yml index d91654319..dace65338 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -192,7 +192,7 @@ build_breaker_epversion: "{% if sonar_version is version(\"7.3\", \">=\") %}2.3. issueresolver_pversion: 1.0.2 -branch_pversion: "{% if sonar_version is version(\"8.9.0.43852\", \">=\") %}1.8.0\ +branch_pversion: "{% if sonar_version is version(\"8.9.0.43852\", \">=\") %}1.8.1\ {% elif sonar_version is version(\"8.7.0.41497\", \">=\") %}1.7.0\ {% elif sonar_version is version(\"8.5.0.37579\", \">=\") %}1.6.0\ {% elif sonar_version is version(\"8.2.0.32929\", \">=\") %}1.5.0\ @@ -246,6 +246,9 @@ sonar_default_plugins: - 'https://binaries.sonarsource.com/Distribution/sonar-jacoco-plugin/sonar-jacoco-plugin-{{ jacoco_pversion }}.jar' sonar_install_optional_plugins: false + +branch_plugin_url: "https://github.com/mc1arke/sonarqube-community-branch-plugin/releases/download/\ + {{ branch_pversion }}/sonarqube-community-branch-plugin-{{ branch_pversion }}.jar" sonar_optional_plugins: - "https://github.com/QualInsight/qualinsight-plugins-sonarqube-smell/releases/download/\ @@ -281,8 +284,7 @@ sonar_optional_plugins: - "https://github.com/willemsrb/sonar-issueresolver-plugin/releases/download/sonar-issueresolver-plugin-{{ issueresolver_pversion }}/\ sonar-issueresolver-plugin-{{ issueresolver_pversion }}.jar" - - "https://github.com/mc1arke/sonarqube-community-branch-plugin/releases/download/\ - {{ branch_pversion }}/sonarqube-community-branch-plugin-{{ branch_pversion }}.jar" + - '{{ branch_plugin_url }}' sonar_all_plugins: "{{ sonar_install_recommended_plugins | ternary(sonar_recommended_plugins, []) +\ sonar_update_default_plugins | ternary(sonar_default_plugins, []) +\ diff --git a/tasks/system/Linux.yml b/tasks/system/Linux.yml index 42f3cdd74..cc1ec6972 100644 --- a/tasks/system/Linux.yml +++ b/tasks/system/Linux.yml @@ -146,11 +146,6 @@ notify: Restart Sonarqube loop: '{{ sonar_all_plugins }}' - - name: Get branch plugin url - set_fact: - branch_plugin_url: "https://github.com/mc1arke/sonarqube-community-branch-plugin/releases/download/\ - {{ branch_pversion }}/sonarqube-community-branch-plugin-{{ branch_pversion }}.jar" - - name: Copy branch plugin copy: src: '{{ sonar_plugins_dir }}/sonarqube-community-branch-plugin-{{ branch_pversion }}.jar' @@ -158,8 +153,9 @@ mode: 0644 remote_src: true when: - - branch_pversion is version("1.2.0", ">=") - branch_plugin_url in sonar_all_plugins + - branch_pversion is version("1.2.0", ">=") + - branch_pversion is version("1.7.0", "<=") - meta: flush_handlers diff --git a/templates/sonar.properties.j2 b/templates/sonar.properties.j2 index c3cb332ce..689704ec5 100644 --- a/templates/sonar.properties.j2 +++ b/templates/sonar.properties.j2 @@ -19,6 +19,12 @@ sonar.ce.javaOpts={{ sonar_java_opts.ce }} # CVE-2021-44228, to remove after elasticsearch/lib/log4j-*.jar updated to 2.15.0+ version sonar.search.javaAdditionalOpts=-Dlog4j2.formatMsgNoLookups=true +{% if branch_plugin_url in sonar_all_plugins and branch_pversion is version("1.8.0", ">=") %} +# branch plugin +sonar.web.javaAdditionalOpts=-javaagent:./extensions/plugins/sonarqube-community-branch-plugin-{{ branch_pversion }}.jar=web +sonar.ce.javaAdditionalOpts=-javaagent:./extensions/plugins/sonarqube-community-branch-plugin-{{ branch_pversion }}.jar=ce +{% endif %} + # update center sonar.updatecenter.activate={{ sonar_updatecenter_activate | bool | lower }}