如何使用Jenkins运行不同机器的Jmeter脚本

发布于 2025-02-08 20:00:19 字数 114 浏览 1 评论 0原文

我们可以像我的脚本一样在另一台远程计算机上运行詹金斯(Jenkins)构建,而我的詹金斯(Jenkins)设置在其他远程计算机上? 我在不同的机器上创建了多个JMX脚本,但我想从一台计算机上的Jenkins运行它们

Can we run Jenkins build for a different machine like my script is on another remote machine and my Jenkins setup is on a different remote machine?
I have multiple JMX scripts created on different machines but I want to run them from Jenkins on a single machine

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

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

发布评论

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

评论(2

白首有我共你 2025-02-15 20:00:19

是的,有多种方法可以做到这一点。一种方法是您可以使用jenkins ssh steps插件。以下是远程执行命令的示例。

node {
  def remote = [:]
  remote.name = 'test'
  remote.host = 'test.domain.com'
  remote.user = 'root'
  remote.password = 'password'
  remote.allowAnyHosts = true
  stage('Remote SSH') {
    sshCommand remote: remote, command: "ls -lrt"
    sshCommand remote: remote, command: "for i in {1..5}; do echo -n \"Loop \$i \"; date ; sleep 1; done"
  }
}

Yes, there are multiple ways to do this. One way is you can use the Jenkins SSH Steps plugin for this. Following is an example for a remote execution of a command.

node {
  def remote = [:]
  remote.name = 'test'
  remote.host = 'test.domain.com'
  remote.user = 'root'
  remote.password = 'password'
  remote.allowAnyHosts = true
  stage('Remote SSH') {
    sshCommand remote: remote, command: "ls -lrt"
    sshCommand remote: remote, command: "for i in {1..5}; do echo -n \"Loop \$i \"; date ; sleep 1; done"
  }
}
盗梦空间 2025-02-15 20:00:19

将这些机器连接到詹金斯(Jenkins)作为构建代理,然后将项目或管道设置为在远程计算机上执行,或在这些机器上安装Jmeter奴隶,然后在詹金斯(Jenkins)上设有Jmeter Master的测试。

更多信息:

Either connect these machines to Jenkins as Build Agents and set your project or pipeline to execute on the remote machine(s) or install JMeter Slaves on those machines and run your test on Jenkins having JMeter Master there.

More information:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文