gitlab CI not checking out latest submodule's commit
Hi,
Am I wrong in assuming that setting 'GIT_SUBMODULE_STRATEGY' variable to recursive should enable checking out the latest commit of the relevant submodules?
Using this yml where 'test' is my submodule (only partial):
variables:
GIT_SUBMODULE_STRATEGY: recursive
before_script:
- git submodule update --init
- cd stgc/gitmodules/test
- git fetch
- git merge origin/master
- cd ../../..
I get this output:
Cloning repository...
Cloning into '/builds/atlas-muon-nsw-db/web'...
Checking out 022ac37a as master...
Updating/initializing submodules recursively...
Submodule 'stgc/gitmodules/test' (https://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@gitlab.cern.ch/mbirman/test.git) registered for path 'stgc/gitmodules/test'
Cloning into '/builds/atlas-muon-nsw-db/web/stgc/gitmodules/test'...
Submodule path 'stgc/gitmodules/test': checked out '2f46cb8774809e5fed4242bfaff5932ded2aefc2'
$ git submodule update --init
$ cd stgc/gitmodules/test
$ git fetch
$ git merge origin/master
Updating 2f46cb8..c64ca4d
Fast-forward
stam.txt | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
$ cd ../../..
You can see that the manual fetch/merge after the automatic update still adds changes.
Short description of my objective: I have a project A with a submodule B. Whenever a push on B is done I am triggering an update on A with a webhook. The update on A includes CI-running a script that uses the files in B, so I really need to get the latest commit in B.
Thanks for any advice on getting the latest commit of the submodules, or even for suggestions of different strategies that would be better to get this working.
Cheers, Mattias