恢复 Sonarqube (5.2) war 部署?

Bring back Sonarqube (5.2) war deployment?

在 'old' 的日子里,人们可以选择将 sonarqube 作为独立安装或作为 WAR 安装到像 Tomcat 或 Jetty 这样的 servlet 容器中。

(我们目前正在使用 msbuild runner 将 VSO 构建环境与 Sonarqube 和 Azure 集成。)

在这个(云)技术堆栈中,我们need/want 将sonarqube 部署到Azure 云。因为它只能作为独立实例安装,所以我需要实例化和管理一个完整的 Azure VM 实例。 如果 SonarQube 可以安装为 WAR,我将能够将其部署为 Azure Web 应用程序,这样会更有效(成本、维护……)。

SonarQube 是否有恢复 WAR 部署的计划?

简短回答:目前没有恢复WAR部署的计划。

长答案:由于我们与 Microsoft 建立了合作伙伴关系(正如您在过去几个月中可能已经看到的那样),这是我们意识到的需求,并且可能会在某一天恢复 table .

您的基本要求是在 Azure 网站中托管 SonarQube。

Azure Web Apps 支持 custom Java apps 的部署。它利用 IIS 中的 httpPlatformHandler 模块来实现相同的目的。

步骤如下-

  1. 将 SonarQube windows-x64 包复制到 Web 应用程序中的 wwwroot
  2. 在此根目录下部署一个 web.config,格式如下

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
      <system.webServer>
        <handlers>
          <add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
        </handlers>
        <httpPlatform processPath="%HOME%\site\wwwroot\bin\windows-x86-64\StartSonar.bat">
          <environmentVariables>
            <environmentVariable name="HTTP_PLATFORM_PORT" value="%HTTP_PLATFORM_PORT%" />
            <environmentVariable name="JAVA_HOME" value="%JAVA_HOME%" />
          </environmentVariables>
        </httpPlatform>
      </system.webServer>
    </configuration>
    
  3. sonar.web.port(在 sonar.properties 中)配置为 ${env:HTTP_PLATFORM_PORT}。这是必要的,因为 Azure Web 应用程序在每次启动时都会分配随机端口。上面显示的 web.config 中设置了环境变量。