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

View File

@@ -14,24 +14,11 @@ update_os
JAVA_VERSION="21" setup_java
PG_VERSION="17" setup_postgresql
PG_DB_NAME="sonarqube" PG_DB_USER="sonarqube" setup_postgresql_db
msg_info "Installing Postgresql"
DB_NAME="sonarqube"
DB_USER="sonarqube"
DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)
$STD sudo -u postgres psql -c "CREATE USER $DB_USER WITH PASSWORD '$DB_PASS';"
$STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME OWNER $DB_USER;"
{
echo "Application Credentials"
echo "DB_NAME: $DB_NAME"
echo "DB_USER: $DB_USER"
echo "DB_PASS: $DB_PASS"
} >>~/sonarqube.creds
msg_ok "Installed PostgreSQL"
msg_info "Configuring SonarQube"
msg_info "Setting up 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