SonarQube: Fixes (#9875)

* Fixes

* Update
This commit is contained in:
Slaviša Arežina
2025-12-11 10:52:49 +01:00
committed by GitHub
parent 091271c8d6
commit de944792de
2 changed files with 11 additions and 24 deletions
+8 -8
View File
@@ -33,30 +33,30 @@ function update_script() {
systemctl stop sonarqube
msg_ok "Stopped Service"
msg_info "Creating backup"
msg_info "Creating Backup"
BACKUP_DIR="/opt/sonarqube-backup"
mv /opt/sonarqube ${BACKUP_DIR}
msg_ok "Backup created"
msg_ok "Created Backup"
msg_info "Installing sonarqube"
msg_info "Updating SonarQube"
temp_file=$(mktemp)
RELEASE=$(curl -fsSL https://api.github.com/repos/SonarSource/sonarqube/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
RELEASE=$(get_latest_github_release "SonarSource/sonarqube")
curl -fsSL "https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-${RELEASE}.zip" -o $temp_file
unzip -q "$temp_file" -d /opt
mv /opt/sonarqube-* /opt/sonarqube
msg_ok "Installed sonarqube"
msg_ok "Updated SonarQube"
msg_info "Restoring backup"
msg_info "Restoring Backup"
cp -rp ${BACKUP_DIR}/data/ /opt/sonarqube/data/
cp -rp ${BACKUP_DIR}/extensions/ /opt/sonarqube/extensions/
cp -p ${BACKUP_DIR}/conf/sonar.properties /opt/sonarqube/conf/sonar.properties
rm -rf ${BACKUP_DIR}
chown -R sonarqube:sonarqube /opt/sonarqube
msg_ok "Backup restored"
msg_ok "Restored Backup"
msg_info "Starting Service"
systemctl start sonarqube
msg_ok "Service started"
msg_ok "Service Started"
msg_ok "Updated successfully!"
fi
exit