【问题标题】:Latexmk: command not found with Gitalb CILatexmk:在 Gitlab CI 中找不到命令
【发布时间】:2022-01-15 01:55:12
【问题描述】:

我正在尝试在 Gitlab 中创建一个带有 CI 的存储库,该 CI 自动将 .tex 文件编译为 PDF。

使用 LaTeX 的 Gtilab 模板 (https://gitlab.com/gitlab-org/gitlab-foss/-/blob/master/lib/gitlab/ci/templates/LaTeX.gitlab-ci.yml) 因此我的 .gtilab-ci.yml 如下所示。

variables:
 
  LATEX_IMAGE: listx/texlive:2020

build:
  image: $LATEX_IMAGE
  script:
    - latexmk -pdf

  artifacts:
    paths:
      - "main.pdf"

在我的主存储库中显然还有一个 main.tex。

在提交更改时,作业按假设开始,但在尝试执行脚本时失败。我在这里附上日志以供参考:

Running with gitlab-runner 14.5.1 (de104fcd)
  on selenium
Preparing the "shell" executor 00:00
Using Shell executor...
Preparing environment 00:00
Running on selenium...
Getting source from Git repository 00:00
Fetching changes with git depth set to 50...
Bestehendes Git-Repository in /some/anonymised/path neuinitialisiert
Checking out 4f46c62b as feature-setup...
Skipping Git submodules setup
Executing "step_script" stage of the job script 00:00
$ latexmk -pdf
bash: Zeile 120: latexmk: Kommando nicht gefunden.
Cleaning up project directory and file based variables 00:00
ERROR: Job failed: exit status 1

总的来说,我对使用 Gitlab 的 CI/CD 实施相当陌生。所以我不确定要进一步调试什么以及问题可能出在哪里。

提前致谢!

【问题讨论】:

    标签: gitlab latex gitlab-ci


    【解决方案1】:

    该作业正在使用 GitLab shell executor(来自日志:Preparing the "shell" executor 00:00),它将在本地机器上而不是在指定的 Docker 容器中运行 script 命令。

    一些解决方案是:

    • 在您的主机上安装 GitLab docker runner(首选选项),或
    • texlive 安装到运行gitlab-runner 的本地计算机上

    【讨论】:

      猜你喜欢
      • 2018-12-14
      • 1970-01-01
      • 2020-06-02
      • 1970-01-01
      • 1970-01-01
      • 2019-03-03
      • 2017-11-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多