Code Monkey home page Code Monkey logo

Comments (6)

vanderby avatar vanderby commented on August 11, 2024 1

@caosborn thanks a bunch!

from sonarqube-azureappservice.

jeckyl2010 avatar jeckyl2010 commented on August 11, 2024

There's a couple issues that will prevent this from working with SonarQube 10.x (and anything after). First, the sorting of the releases retrieved from GitHub is using alpha, so 9 will always be higher than 10:

    if(!$Version -or ($Version -ieq 'Latest')) {
        # binaries.sonarsource.com moved to S3 and is not easily searchable anymore. Getting the latest version from GitHub releases.
        $releasesFromApi = (Invoke-WebRequest -Uri 'https://api.github.com/repos/SonarSource/sonarqube/releases' -UseBasicParsing).Content
        $releasesPS = $releasesFromApi | ConvertFrom-Json
        $Version = $releasesPS.Name | Sort-Object -Descending | Select-Object -First 1
        Write-Output "Found the latest release to be $Version"
    }

The code above will always find 9.x as the latest release.

Second, the version comparison in the startup script is alpha, having the same problem of 10 being less than 9:

$sqver = $propFile.FullName.split("\")[4].split("-")[1]
log("SQ version: $sqver")
if ($sqver -ge 9.6) {
    log("SQ ver >= 9.6, use env var not wrapper.conf")
    $Env:SONAR_JAVA_PATH = "$Env:JAVA_HOME\bin\java.exe"
    log("Set Java exe path env var (SONAR_JAVA_PATH) to: $Env:SONAR_JAVA_PATH")
} else {
    log('SQ ver < 9.6, use wrapper.conf')

$sqver is a string so "10.1" will always be less than "9.6".

I'm facing the exact same problem, due to the inherit problem of sorting or comparing numerical values as strings.

Are pull requests something to consider ?

from sonarqube-azureappservice.

 avatar commented on August 11, 2024

Facing the exact same issue. It does not pull the Latest 10.2 and I can't define version 10.2 as well when deploying. When deploying add version manually from the https://api.github.com/repos/SonarSource/sonarqube/releases and it works.

image

But, then again it shows

image

from sonarqube-azureappservice.

vanderby avatar vanderby commented on August 11, 2024

@jeckyl2010 I am always open to PR submissions.

As I don't use SQ on a daily basis anymore changes are pretty much community driven at this point.

from sonarqube-azureappservice.

caosborn avatar caosborn commented on August 11, 2024

I've submitted a PR for this #86

from sonarqube-azureappservice.

caosborn avatar caosborn commented on August 11, 2024

No worries, hope it helps 🙂

from sonarqube-azureappservice.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.