在 Gitlab CI 作業中使用 Git 子模組

在 Gitlab CI 作業中使用 Git 子模組

概括

Git 子模組在 CI 作業中不起作用

重現步驟

  • 建立文件.gitmodules [submodule "database_schema"] path = database_schema url = ../../nss/database_schema.git

  • 我的.gitlab-ci.yml

````

variables:
  GIT_SUBMODULE_STRATEGY: recursive

rspec:
  stage: test
  before_script:
    - ls
    - cd database_schema

````

目前是什麼情況漏洞行為?

我無法存取 ci 作業中的子模組存儲庫。

$ cd database_schema /bin/bash: line 63: cd: database_schema: No such file or directory

但我可以看到這條線遞歸更新/初始化子模組。在我的工作中 Fetching changes... Checking out e5ed3c03 as master... Updating/initializing submodules recursively... Checking cache for master... Successfully extracted cache

相關內容