【问题标题】:Bring back Sonarqube (5.2) war deployment?带回 Sonarqube (5.2) 战争部署?
【发布时间】:2016-02-07 07:49:53
【问题描述】:

在“旧”时代,人们可以选择将 sonarqube 作为独立安装或作为 WAR 安装到 Tomcat 或 Jetty 等 servlet 容器。

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

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

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

【问题讨论】:

  • 这个关于路线图的问题并不适合 StackOverflow。下次请联系 Google 群组:sonarqube@googlegroups.com 以允许讨论。

标签: msbuild sonarqube war azure-web-app-service azure-devops


【解决方案1】:

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

Azure Web 应用支持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 中设置,如上所示。

【讨论】:

    【解决方案2】:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-01-24
      • 2012-04-14
      • 2019-03-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多