4

I created a .gitmodules file in the root of MASTER's project:

[submodule "SLAVE"]
    path = SLAVE
    url = ../../my-group/SLAVE.git

Added to MASTER's .gitlab-ci.yml:

variables:
  GIT_SUBMODULE_STRATEGY: recursive

Triggered MASTER's CI pipeline.

As a result, no changes made in SLAVE project were applied while running MASTER's CI

  • It downloads the submodules. Git submodules don't update to latest by default. – Jakub Kania Sep 21 '18 at 10:21
  • @JakubKania, could you advise what should be done to have "slave" project updated during running "master's" CI? – Julia Nevinglovskaya Sep 24 '18 at 11:39
  • 1
    Well, run an update manually in before_script: https://stackoverflow.com/questions/5828324/update-git-submodule-to-latest-commit-on-origin/21195182 , though my advise would be to use proper dependency managment instead of git submodules – Jakub Kania Sep 24 '18 at 11:48

1 Answers1

0

You need to add GIT_SUBMODULE_UPDATE_FLAGS to the .gitlab-ci.yml.

variables:
    GIT_SUBMODULE_STRATEGY: recursive
    GIT_SUBMODULE_UPDATE_FLAGS: --remote --merge
ouflak
  • 2,458
  • 10
  • 44
  • 49