与Jenkins,Jmeter和Sonarqube在不同的服务器上创建CICD管道

发布于 2025-02-03 19:36:15 字数 152 浏览 2 评论 0 原文

我的雇主为我提供了3个不同的RHEL服务器,每个服务器分别与Jenkins,Jmeter和Sonarqube一起安装。我必须创建一个集成所有这些组件的CICD管道。谁能指向我应该如何做到这一点的正确方向?这是我第一次与Jenkins Pipelines合作,因此,如果以前已经问过,很抱歉。

My employer has provided me with 3 different RHEL servers, each installed with Jenkins, JMeter and SonarQube separately. I have to create a CICD pipeline integrating all these components. Can anyone point me in the right direction as to how should I go about doing that? This is my first time working with Jenkins pipelines, so, apologies if it has already been asked before.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

晨光如昨 2025-02-10 19:36:15
  1. First of all get familiarized with Jenkins Distributed Builds, it's possible to connect so called "build agent" to Jenkins via SSH, JNLP or WebSocket so the job triggered on JMeter Master will be invoked on the build agent and the status and result will be returned back over the network

  2. JMeter is a pure Java application which can be executed as a command line application as sh pipeline step so it would be something like:

    stage('Run JMeter test') {
        steps {
            sh './path/to/your/jmeter/bin/jmeter.sh -t /path/to/your/testplan.jmx -f -l result.jtl'
        }
    }
    

    if you want to use Performance Plugin to create performance trend charts on the build dashboard and mark build as unstable or failed if SLAs are not met you can add a stage for this as well:

    stage('Performance Report') {
        steps {
            perfReport filterRegex: '', showTrendGraphs: true, sourceDataFiles: '**/*.jtl'
        }
    }
    
  3. For Sonarqube there are too many possible options, check out SonarScanner for Jenkins page and choose the one which matches your project/language

    stage('SonarQube') {
      def scannerHome = tool 'SonarScanner 4.0';
      withSonarQubeEnv('My SonarQube Server') { 
        sh "${scannerHome}/bin/sonar-scanner"
    }
    
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文