首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Gitlab CI和matlab

Gitlab CI和matlab
EN

Stack Overflow用户
提问于 2019-06-28 07:03:35
回答 1查看 489关注 0票数 1

我正在尝试为我在gitlab上的一个相当大的Matlab代码设置一些测试。

我创建了.gitlab-ci.yml文件,该文件启动一个bash脚本,然后调用matlab。

代码语言:javascript
复制
#.gitlab-ci.yml

before_script:

Test:
  script:
    - chmod +x RunTests.sh
    - ./RunTests.sh

bash脚本如下所示:

代码语言:javascript
复制
# 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。

代码语言:javascript
复制
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?

EN

回答 1

Stack Overflow用户

发布于 2019-06-28 07:33:32

对于我们项目中的特定跑步者,我在.gitlab-ci.yml中为作业指定标记

类似于:

代码语言:javascript
复制
Test:
  script:
    - chmod +x RunTests.sh
    - ./RunTests.sh
  tags:
    - runners-tag

更多信息请访问

https://docs.gitlab.com/ee/ci/yaml/#tags

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56799328

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档