matlab - Gitlab CI 和 matlab
问题描述
我正在尝试为我在 gitlab 上的相当大的 Matlab 代码设置一些测试。
我创建了 .gitlab-ci.yml 文件,该文件启动一个 bash 脚本,然后调用 matlab。
#.gitlab-ci.yml
before_script:
Test:
script:
- chmod +x RunTests.sh
- ./RunTests.sh
bash 脚本如下:
# RunTests.sh
cd IntegratedTests
LOGFILE=log.txt
matlab -nodesktop -nosplash -minimize -wait -logfile "$LOGFILE" -r 'RunTests';
CODE=$?
cat "$LOGFILE"
exit $CODE
但是,gitlab 尝试使用共享的 gitlab-runner,它使用来自 ruby 的 docker 映像。测试最终失败,因为它在 docker-image 上找不到 matlab。
Running with gitlab-runner 12.0.0-rc1 (58d8360f)
on docker-auto-scale ed2dce3a
Using Docker executor with image ruby:2.5 ...
Pulling docker image ruby:2.5 ...
Using docker image sha256:80f53b90f8657c63c8d35d5eff399e6410baf19013c3b4c1c4158b2029060147 for ruby:2.5 ...
Running on runner-ed2dce3a-project-11747478-concurrent-0 via runner-ed2dce3a-srm-1561674473-a1c90512...
Fetching changes...
Initialized empty Git repository in /builds/darsim2simulator/darsim2/.git/
Created fresh repository.
From https://gitlab.com/darsim2simulator/darsim2
* [new branch] 3-fixed-time-step-size -> origin/3-fixed-time-step-size
* [new branch] 4-single-temperature-formulation-for-geothermal -> origin/4-single-temperature-formulation-for-geothermal
* [new branch] FIMLTS -> origin/FIMLTS
* [new branch] master -> origin/master
* [new branch] patch-1 -> origin/patch-1
* [new branch] patch-2 -> origin/patch-2
* [new branch] patch-3 -> origin/patch-3
Checking out ff3f0a4f as master...
Skipping Git submodules setup
$ chmod +x RunTests.sh
$ ./RunTests.sh
./RunTests.sh: line 6: matlab: command not found
cat: log.txt: No such file or directory
ERROR: Job failed: exit code 1
我猜问题是docker-image上没有安装matlab
这是我第一次使用 gilab CI,所以我可能没有正确理解如何使用它,但我的替代方案是什么?如何设置具有 matlab 的跑步者?
解决方案
对于我们项目中的特定跑步者,我在.gitlab-ci.yml
就像是:
Test:
script:
- chmod +x RunTests.sh
- ./RunTests.sh
tags:
- runners-tag
更多信息在
推荐阅读
- bash - 在单个文件上运行多个 shell 命令并将输出重定向到同一个文件
- xml - 从子节点中选择父节点
- sql - 正则表达式在 Redshift 中将 CamelCase 转换为蛇形案例
- python - python - 检查单词是否在充满字符串的列表中,以及是否在另一个列表中打印单词
- c - 如何使用指针常量来指向 ANSI C 中的特定内存地址(例如,像 0x0001a00 这样的地址)?
- java - JDK 中的哪个类创建了 JRMI ProtocolAck?
- sql - 如何在 Hiveql 中跨列范围压缩多个 where 语句: where icd_proc_cd_1='43644' or ... or icd_proc_cd_28='43644'
- javascript - JavaScript 在用户缓存中选择
- cluster-analysis - K-means 聚类错误:只有 0 可能与负下标混合
- python - 在 Pandas (Python) 中拆分列中的所有数据