GitLab CI 在存储库中使用未跟踪的文件

GitLab CI use untracked files in repository

我目前正在评估 GitLab CI/CD 并试图让管道正常工作,但是我有一个简单的(?)问题。

我正在尝试通过自动更新 ISO 映像来自动化构建过程。但是,这些 ISO 映像不会被存储库跟踪并在 .gitignore 文件中被忽略。但这导致了当我尝试 运行 make 时找不到 ISO 映像的问题...

我只是在使用一个简单的 .gitlab-ci.yml 文件:

stages:
  - build

build:
  stage: build
  script:
    - make

当我在 GitLab CI 界面中尝试 运行ning 时,它克隆了存储库(没有 ISO 映像),然后失败了,因为该 make 目标没有规则(因为缺少 ISO 映像)。我已经尝试将文件移动到 GitLab 创建的 "build" 目录中,但是这给出了说它有 failed to remove ...

的错误

如何使用本地存储库而不是让 GitLab 将存储库克隆到 "build" 位置?

您不能将 Gitlab CI 用于您计算机上的文件,至少您不应该这样做。你可以在你的机器上用 ssh-executor that will login to a machine that stores the iso files (and it should be a server rather than your development machine) or you could have the docker executor pull them from ftp/object store. For testing purposes you can run the builds locally 来完成。