1

Hello : I would like to request guidance w.r.t an issue that I'm facing.

I've 2 Repos, and the goal is refer a file from Repo#2 in Repo#1

Repo#1 - https://gitlab.xyz.com/ertm/search/housekeeper_job.git

Repo#2 - https://gitlab.xyz.com/ertm/gitlab-pipeline.git

I’ve defined the .gitmodule file as below inside the housekeeper_job (Repo#1) repository

[submodule "gitlab-pipeline"]
path = gitlab-pipeline
url = ../../gitlab-pipeline.git

In one of the stages in the .gitlab-ci.yml in the housekeeper_job repository, I’m trying to invoke a file( script) residing in the gitlab-pipeline (Repo#2) repository.

source /ertm/gitlab-pipeline/pipeline.sh pipeline.sh is the file which reside in gitlab-pipeline.git in the Root folder.

Excerpt from the Output of the failed Pipeline job

Cloning repository...
Cloning into '/ertm/search/housekeeper_job'...
Checking out 4fe7240d as feature/hkeeper...
Updating/initializing submodules recursively...
Checking cache for default...
Successfully extracted cache
$ source /ertm/gitlab-pipeline/pipeline.sh
/bin/bash: line 87: /ertm/gitlab-pipeline/pipeline.sh: No such file or directory

  • Version of gitlab-runner 11.2.0
  • Version of Enterprise Gitlab 10.X

Can I know what I'm doing wrong or what step I'm missing here?.

4
  • I think you need to get your CI system to git clone --recursive or similar so that it checks our your submodule code.
    – Hitobat
    Sep 3, 2018 at 20:07
  • @Hitobat, I've added GIT_SUBMODULE_STRATEGY: recursive to gitlab-ci.yml.
    – Raj R
    Sep 4, 2018 at 23:31
  • It looks like this is a known issue . gitlab.com/gitlab-org/gitlab-ce/issues/37356
    – Raj R
    Sep 5, 2018 at 0:00
  • You can tell this hasn't worked as the line Updating/initializing submodules recursively... ought to be followed by submodule 'name' (https://gitlab-ci-token:[email protected]/group/name) registered for path 'path' Cloning into '/builds/...'... Submodule path 'path': checked out 'GUID' Jan 27, 2019 at 20:48

1 Answer 1

0

I solved a very similar problem by removing all submodules as described here then using git submodule add <repo> <path>

git submodule add does more than just create a .gitmodule file.

1
  • This appears to be cargo-cult-ism, but allowing the local path to default, as in git submodule add <repo>, never worked for me. Jan 27, 2019 at 20:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.