专属域名
文档搜索
轩辕助手
Run助手
邀请有礼
返回顶部
快速返回页面顶部
收起
收起工具栏
轩辕镜像 官方专业版
轩辕镜像 官方专业版轩辕镜像 官方专业版官方专业版
首页个人中心搜索镜像

交易
充值流量我的订单
工具
提交工单镜像收录一键安装
Npm 源Pip 源Homebrew 源
帮助
常见问题
其他
关于我们网站地图

官方QQ群: 1072982923

cathive/concourse-sonarqube-resource Docker 镜像 - 轩辕镜像

concourse-sonarqube-resource
cathive/concourse-sonarqube-resource
自动构建
Resource for Concourse CI to integrate SonarQube analysis results.
5 收藏0 次下载
🚀 稳定镜像源 = 更少宕机 + 更低运维成本
镜像简介版本下载
🚀 稳定镜像源 = 更少宕机 + 更低运维成本

SonarQube Resource for Concourse CI

Performs SonarQube analyses and tracks the state of SonarQube quality gates.

This resource works with SonarCloud and self-hosted instances of SonarQube.

If you want to implement a real quality gate in your build pipeline, you might want to also use the concourse-sonarqube-qualitygate-task which can be used to break a build if certain quality goals (as reported by SonarQube) are not reached.

Requirements

  • A running SonarQube instance (this resource was tested on v6.5–v7.1, but it should work with every version of SonarQube ≥ v5.3)
  • The base URL of your SonarQube server has to be configured correctly! Otherwise the resource will be unable to fetch analysis results when invoking it's in action. (sonar.core.serverBaseURL in conf/sonar.properties)

Installation

Add a new resource type to your Concourse CI pipeline:

yaml
 resource_types:
 - name: sonar-runner
  type: docker-image
  source:
    repository: cathive/concourse-sonarqube-resource
    tag: latest # For reproducible builds use a specific tag and don't rely on "latest".

Source Configuration

  • host_url: Required. The address of the SonarQube instance, e.g. "[***]" (when using SonarCloud). Must end with a slash.

  • organization: The organization to be used when submitting stuff to a sonarqube instance. This field is required when using SonarCloud to perform the analysis of your code.

  • login: The login or authentication token of a SonarQube user with Execute Analysis permission. Can be left out if SonarQube instance does not require any authentication.

  • password: The password that goes with the sonar.login username. This should be left blank if an authentication token is being used.

  • maven_settings: Maven settings to be used when performing SonarQube analysis. Only used if the scanner_type during the out phase has been set to / determined to use Maven.

  • __debug: This flag is used to debug any problems that might occur when using the resource itself. It enables extra debug output on the console and sets the -x flag during shell execution. It is usually not a good idea to set this flag to true in a production environment, because it might leak passwords and access key credentials to the console where it might be accessed by unauthorized / anonymous users.

Behavior

The resource implements all three actions (check, in and out). The analysis is triggered by the out action and check/in will be used to wait for the result of the analysis and pull in the project status. Tasks can use this information to break the build (if desired) if any of the criteria of the quality gate associated with a project are not met.

out: Trigger SonarQube analysis
Parameters
  • project_path: Required Path to the resource that shall be analyzed. If the path contains a file called "sonar-project.properties" it will be picked up during analysis.

  • scanner_type: Type of scanner to be used. Possible values are:

    • auto (default) Uses the maven-Scanner if a pom.xml is found in the directory specified by sources, cli otherwise.
    • cli Forces usage of the command line scanner, even if a Maven project object model (pom.xml) is found in the sources directory.
    • maven Forces usage of the Maven plugin to perform the scan.
  • project_key: Project key (default value is read from sonar-project.properties)

  • project_key_file: File to be used to read the Project key. When this option has been specified, it has precedence over the project_key parameter.

  • project_name: Project name (default value is read from sonar-project.properties)

  • project_description: Project description (default value is read from sonar-project.properties)

  • project_version: Project version (default value is read from sonar-project.properties)

  • project_version_file: File to be used to read the Project version. When this option has been specified, it has precedence over the project_version parameter.

  • autodetect_branch_name: Try to figure out the branch automatically. This works if the project_path contains recognized SCM metadata from a supported revision control system. (Currently: only Git is supported!)

  • branch_name: Name of the branch. Overrides autodetect_branch_name if it has been set.

  • branch_name_file: File to be used to read the branch name. When this option has been specified, it has precedence over the branch_name parameter.

  • branch_target: Name of the branch where you intend to merge your short-lived branch at the end of its life. If left blank, this defaults to the master branch. It can also be used while initializing a long-lived branch to sync the issues from a branch other than the Main Branch. (See Branch Plugin documentation for further details)

  • branch_target_file: File to be used to read the branch target. When this option has been specified, it has precedence over the branch_target parameter.

  • decorate_pr: If set to true it will try to fetch the pull request id, the head branch name and the base branch name from the pull request resource. It will enable sonar.pullrequest.key, sonar.pullrequest.branch and sonar.pullrequest.base flags when performing your analysis.

    It works for:

    • telia-oss/github-pr-resource

    • zarplata/concourse-git-bitbucket-pr-resource

    • jtarchie/github-pullrequest-resource

    In order to use this feature you must be using SonarCloud or SonarQube Developer edition.

  • sources: A list of paths to directories containing source files.

  • tests: A list of paths to directories containing source files.

  • additional_sonar_scanner_opts: Optional values to be passed in to the $SONAR_SCANNER_OPTS env variable. Can be used to provide parameters to Sonar before the scanner process starts. This is at the moment essentially necessary for HTTP proxy settings.

  • additional_properties: Optional object/dictionary that may contain any additional properties that one might want to pass when running the sonar-scanner.

  • additional_properties_file: Optional path to a file containing properties that should be passed to the sonar-scanner.

  • maven_settings_file: Path to a Maven settings file that shall be used. Only used if the scanner_type during has been set to / determined to use Maven. If the resource itself has a maven_settings configuration, this key will override it's value.

  • sonar_maven_plugin_version: sonar-maven-plugin version (default is empty and using the latest version)

Wildcards Support

Support convert wildcards to comma-separated paths.

  • sources
  • tests
  • Any key with the suffix .reportPaths in additional_properties
in: Fetch result of SonarQube analysis

The action will place two JSON files into the resource's folder which are fetched from the SonarQube Web API:

Parameters
  • quality_gate: Optional JSON Enable quality_gate checker and control get step success/failure.
    • ignore_all_warn: bool Ignore all WARN metrics and let get step success
    • ignore_all_error: bool Ignore all ERROR metrics and let get step success
    • ignore_warns: array A list of metric keys for WARN metric to ignore while quality_gate checking.
    • ignore_errors: array A list of metric keys for ERROR metric to ignore while quality_gate checking.

Note: for ignore_warns/ignore_errors, possible value could be found through

  • https://<your-sonar_host>/quality_gates/show/<quality_gate_id>
  • https://<your-sonar_host>/api/qualitygates/show?id=<quality_gate_id>
Outputs
  • qualitygate_project_status.json Quality gate status of the compute engine task that was triggered by the resource during the out action. Format: [***]
  • ce_task_info.json Information about the compute engine task that performed the analysis. Format: [***]

Full example

The following example pipeline shows how to use the resource to break the build if a project doesn't meet the requirements of the associated quality gate.

yaml
resource_types:

- name: sonar-runner
  type: docker-image
  source:
    repository: cathive/concourse-sonarqube-resource
    tag: latest # For reproducible builds use a specific tag and don't rely on "latest".

resources:

- name: sources
  type: git
  source:
    uri: [***]

- name: artifact
  type: s3
  # ... configuration omitted

- name: code-analysis
  type: sonar-runner
  source:
    host_url: [***]
    login: ((sonarqube-auth-token))

jobs:

# The build job performs fetches stuff from the "sources" resource
# and executes a task that builds and tests everything. Once compilation,
# test execution and <whatever> has been performed, we copy the whole
# working directory into the output folder "sonarqube-analysis-input"
# and push the package that has been created by the "build" task to the
# artifact resource and utilize the sonarqube-resource to perform static
# code analysis.
- name: build-and-analyze
  plan:
  - get: sources
    trigger: true
  - task: build
    config:
      platform: linux
      image_resource:
        type: docker-image
        source:
          repository: debian
          tag: 'jessie'
      inputs:
      - name: sources
      outputs:
      # Hint: The sonar-runner needs more than just the
      # sources to perform a full analysis. Line coverage reports, unit test reports,
      # Java class files and mutation test results should also be present.
      # Therefore, you'll have to make sure that your build script provides the sources
      # and the compilation/test results in your Concourse CI build plan.
      # (And that is the reason, why we need the following output)
      - name: sonarqube-analysis-input
      run:
        path: build.sh
        dir: sources
  - in_parallel:
    - put: code-analysis
      params:
        project_path: sonarqube-analysis-input
        project_key: com.example.my_project
        sources: ["."]
        tests: ["."]
        additional_properties:
          # Will be passed as "-Dsonar.javascript.lcov.reportPaths="coverage/lcov.info" to the scanner.
          sonar.javascript.lcov.reportPaths: coverage/lcov.info
      get_params:
        quality_gate:
          ignore_errors: ['new_coverage', 'violations']
          ignore_warns: ['new_duplicated_lines_density', 'violations']
    - put: artifact

# The qualitygate task breaks the build if the analysis result from SonarQube
# indicates that any of our quality metrics have not been met.
- name: qualitygate
  plan:
  - in_parallel:
    - get: artifact
      passed:
      - build-and-analyze
    - get: code-analysis
      passed:
      - build-and-analyze
      trigger: true
  - task: check-sonarqube-quality-gate
    config:
      platform: linux
      image_resource:
        type: docker-image
        source:
          repository: cathive/concourse-sonarqube-qualitygate-task
          tag: latest # Use one of the versioned tags for reproducible builds!
      inputs:
      - name: code-analysis
      run:
        path: /sonarqube-qualitygate-check
        dir: code-analysis

# We deploy only artifacts that have made it through our quality gate!
- name: deploy
  plan:
  - get: artifact
    passed:
    - qualitygate

查看更多 concourse-sonarqube-resource 相关镜像 →
cycloid/concourse-sonarqube-resource logo
cycloid/concourse-sonarqube-resource
Concourse CI的SonarQube资源镜像,用于将SonarQube代码扫描集成到CI/CD流程,升级Sonar Scanner CLI至5.0.1.3006版本,并将认证参数从sonar.login调整为sonar.token,提升兼容性与安全性。
10K+ pulls
上次更新:未知
concourse/git-resource logo
concourse/git-resource
跟踪Git仓库中的提交,用于CI/CD流程中监控代码提交记录的Concourse资源镜像。
5100M+ pulls
上次更新:未知
concourse/docker-image-resource logo
concourse/docker-image-resource
用于跟踪和构建Docker镜像的资源,提供镜像版本跟踪与自动化构建能力,支持与CI/CD流程集成,适用于Concourse等CI/CD平台。
4100M+ pulls
上次更新:未知
concourse/concourse logo
concourse/concourse
Concourse CI的Docker镜像,提供持续集成/持续部署工具运行环境,支持自动化构建、测试与部署流程,便于快速部署使用。
7550M+ pulls
上次更新:未知
concourse/s3-resource logo
concourse/s3-resource
S3资源镜像通过文件名模式匹配识别版本号,实现S3桶中对象的版本控制。
1100M+ pulls
上次更新:未知
concourse/time-resource logo
concourse/time-resource
Concourse CI的时间资源,用于按配置的时间间隔报告新版本,支持设置任意长的时间间隔。
110M+ pulls
上次更新:未知

轩辕镜像配置手册

探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式

登录仓库拉取

通过 Docker 登录认证访问私有仓库

Linux

在 Linux 系统配置镜像服务

Windows/Mac

在 Docker Desktop 配置镜像

Docker Compose

Docker Compose 项目配置

K8s Containerd

Kubernetes 集群配置 Containerd

K3s

K3s 轻量级 Kubernetes 镜像加速

Dev Containers

VS Code Dev Containers 配置

MacOS OrbStack

MacOS OrbStack 容器配置

宝塔面板

在宝塔面板一键配置镜像

群晖

Synology 群晖 NAS 配置

飞牛

飞牛 fnOS 系统配置镜像

极空间

极空间 NAS 系统配置服务

爱快路由

爱快 iKuai 路由系统配置

绿联

绿联 NAS 系统配置镜像

威联通

QNAP 威联通 NAS 配置

Podman

Podman 容器引擎配置

Singularity/Apptainer

HPC 科学计算容器配置

其他仓库配置

ghcr、Quay、nvcr 等镜像仓库

专属域名拉取

无需登录使用专属域名

需要其他帮助?请查看我们的 常见问题Docker 镜像访问常见问题解答 或 提交工单

镜像拉取常见问题

轩辕镜像免费版与专业版有什么区别?

免费版仅支持 Docker Hub 访问,不承诺可用性和速度;专业版支持更多镜像源,保证可用性和稳定速度,提供优先客服响应。

轩辕镜像支持哪些镜像仓库?

专业版支持 docker.io、gcr.io、ghcr.io、registry.k8s.io、nvcr.io、quay.io、mcr.microsoft.com、docker.elastic.co 等;免费版仅支持 docker.io。

流量耗尽错误提示

当返回 402 Payment Required 错误时,表示流量已耗尽,需要充值流量包以恢复服务。

410 错误问题

通常由 Docker 版本过低导致,需要升级到 20.x 或更高版本以支持 V2 协议。

manifest unknown 错误

先检查 Docker 版本,版本过低则升级;版本正常则验证镜像信息是否正确。

镜像拉取成功后,如何去掉轩辕镜像域名前缀?

使用 docker tag 命令为镜像打上新标签,去掉域名前缀,使镜像名称更简洁。

查看全部问题→

用户好评

来自真实用户的反馈,见证轩辕镜像的优质服务

用户头像

oldzhang

运维工程师

Linux服务器

5

"Docker访问体验非常流畅,大镜像也能快速完成下载。"

轩辕镜像
镜像详情
...
cathive/concourse-sonarqube-resource
官方博客Docker 镜像使用技巧与技术博客
热门镜像查看热门 Docker 镜像推荐
一键安装一键安装 Docker 并配置镜像源
咨询镜像拉取问题请 提交工单,官方技术交流群:1072982923
轩辕镜像面向开发者与科研用户,提供开源镜像的搜索和访问支持。所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
咨询镜像拉取问题请提交工单,官方技术交流群:
轩辕镜像面向开发者与科研用户,提供开源镜像的搜索和访问支持。所有镜像均来源于原始仓库,本站不存储、不修改、不传播任何镜像内容。
官方邮箱:点击复制邮箱
©2024-2026 源码跳动
官方邮箱:点击复制邮箱Copyright © 2024-2026 杭州源码跳动科技有限公司. All rights reserved.