我正在尝试为我在gitlab上的一个相当大的Matlab代码设置一些测试。
我创建了.gitlab-ci.yml文件,该文件启动一个bash脚本,然后调用matlab。
#.gitlab-ci.yml
before_script:
Test:
script:
- chmod +x RunTests.sh
- ./RunTests.shbash脚本如下所示:
# 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的runner?
发布于 2019-06-28 07:33:32
对于我们项目中的特定跑步者,我在.gitlab-ci.yml中为作业指定标记
类似于:
Test:
script:
- chmod +x RunTests.sh
- ./RunTests.sh
tags:
- runners-tag更多信息请访问
https://stackoverflow.com/questions/56799328
复制相似问题