From f57dd7faa5484802bb5ec12d1145b7892b63220f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Nov 2024 11:22:22 +0300 Subject: [PATCH] Bump submodules/xml-plugin from `dccc3b7` to `9a4dbee` (#5492) * Bump submodules/xml-plugin from `dccc3b7` to `9a4dbee` Bumps [submodules/xml-plugin](https://github.com/SonarSource/sonar-xml) from `dccc3b7` to `9a4dbee`. - [Release notes](https://github.com/SonarSource/sonar-xml/releases) - [Commits](https://github.com/SonarSource/sonar-xml/compare/dccc3b71e6bd537efcb35cb6e3b781528ee370c5...9a4dbee999f177f82fb005112f99e308de5e02fb) --- updated-dependencies: - dependency-name: submodules/xml-plugin dependency-type: direct:production ... Signed-off-by: dependabot[bot] * update xml plugin * get logs * fix xml plugin --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Dzmitry Rudnouski --- defaults/main.yml | 3 ++- handlers/main.yml | 23 +++++++++++++++++++ submodules/xml-plugin | 2 +- tasks/system/Linux.yml | 50 ------------------------------------------ 4 files changed, 26 insertions(+), 52 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 7e03d3eb0..79d2d41f1 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -149,7 +149,8 @@ git_pversion: "{% if sonar_version is version(\"8.5.0.37579\", \">=\") %}0.0.0\ {% else %}0.0.0\ {% endif %}" -xml_pversion: "{% if sonar_version is version(\"9.9\", \">=\") %}2.10.0.4108\ +xml_pversion: "{% if sonar_version is version(\"10.1\", \">=\") %}2.11.0.5671\ + {% elif sonar_version is version(\"9.9\", \">=\") %}2.10.0.4108\ {% elif sonar_version is version(\"8.9\", \">=\") %}2.7.0.3820\ {% elif sonar_version is version(\"7.0\", \">=\") %}2.4.0.3273\ {% else %}0.0.0\ diff --git a/handlers/main.yml b/handlers/main.yml index 11137e9ff..71bd6bade 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -10,6 +10,9 @@ - Wait for migrate DB - Migrate DB - Wait for Sonarqube + - Show logs + - Debug + - Fail when: sonar_start_by_service | bool become: true @@ -22,6 +25,9 @@ - Wait for migrate DB - Migrate DB - Wait for Sonarqube + - Show logs + - Debug + - Fail when: not (sonar_start_by_service | bool) - name: Wait for migrate DB @@ -52,3 +58,20 @@ until: "'UP' in uri_result.content" retries: 40 delay: 3 + ignore_errors: true + + - name: Show logs + ansible.builtin.shell: 'cat {{ sonar_installation }}/logs/*' + register: logs + changed_when: logs.rc != 0 + when: "'UP' not in uri_result.content" + + - name: Debug + ansible.builtin.debug: + var: logs.stdout + when: "'UP' not in uri_result.content" + + - name: Fail + ansible.builtin.fail: + msg: SonarQube failed to start, see logs above + when: "'UP' not in uri_result.content" diff --git a/submodules/xml-plugin b/submodules/xml-plugin index dccc3b71e..9a4dbee99 160000 --- a/submodules/xml-plugin +++ b/submodules/xml-plugin @@ -1 +1 @@ -Subproject commit dccc3b71e6bd537efcb35cb6e3b781528ee370c5 +Subproject commit 9a4dbee999f177f82fb005112f99e308de5e02fb diff --git a/tasks/system/Linux.yml b/tasks/system/Linux.yml index 5ceedff09..f5e9cce3c 100644 --- a/tasks/system/Linux.yml +++ b/tasks/system/Linux.yml @@ -173,56 +173,6 @@ - name: Flush handlers ansible.builtin.meta: flush_handlers - rescue: - - name: Show logs - ansible.builtin.command: 'ls {{ sonar_installation }}/logs/' - register: logs_list - changed_when: logs_list.rc != 0 - - - name: Debug - ansible.builtin.debug: - var: logs_list.stdout - - - name: Get sonar log - ansible.builtin.command: 'cat {{ sonar_log_path }}' - register: sonar_log - changed_when: sonar_log.rc != 0 - - - name: Debug - ansible.builtin.debug: - var: sonar_log.stdout - - - name: Get es log - ansible.builtin.command: 'cat {{ sonar_installation }}/logs/es.log' - register: es_log - changed_when: es_log.rc != 0 - - - name: Debug - ansible.builtin.debug: - var: es_log.stdout - - - name: Get web log - ansible.builtin.command: 'cat {{ sonar_installation }}/logs/web.log' - register: web_log - changed_when: web_log.rc != 0 - - - name: Debug - ansible.builtin.debug: - var: web_log.stdout - - - name: Get nohup log - ansible.builtin.command: 'cat {{ sonar_installation }}/logs/nohup.log' - register: nohup_log - when: - - sonar_version is version("8.0", ">=") - changed_when: nohup_log.rc != 0 - - - name: Debug - ansible.builtin.debug: - var: nohup_log.stdout - when: - - sonar_version is version("8.0", ">=") - - name: Verify login with old password ansible.builtin.uri: url: '{{ sonar_check_url }}/api/authentication/login'