GitLab CI/CD集成Artillery报错:/home/node/artillery/bin/artillery未找到
解决GitLab CI中Artillery路径找不到的问题
问题背景
在GitLab CI/CD中集成Artillery性能测试时,使用官方文档提供的配置,流水线运行失败,核心报错:
/bin/sh: eval: line 125: /home/node/artillery/bin/artillery: not found
原因分析
Artillery官方Docker镜像(artilleryio/artillery:latest)的最新版本中,artillery可执行文件已被加入系统环境变量PATH,无需使用文档里的旧绝对路径调用;原文档中的/home/node/artillery/bin/artillery路径已不再适配当前镜像。
解决方案
修改CI配置的script部分,直接使用artillery命令即可:
artillery: image: name: artilleryio/artillery:latest entrypoint: [""] script: | mkdir reports artillery run --output reports/report.json tests/performance/socket-io.yml artillery report --output reports/report reports/report.json artifacts: paths: - reports
可选验证步骤
若不确定命令路径,可在script中先添加which artillery查看实际路径,确认命令是否在PATH中:
script: | which artillery mkdir reports # ... 后续测试命令
内容的提问来源于stack exchange,提问作者yam09
相关产品推荐
相关产品推荐

