I have a git repository with git sub-module, which linked to another git repository.
main-repo
-> file1.txt
-> submodule-repo
-> file2.txt
I created a Google Cloud Build trigger that has permissions to main-repo
.
In order to load the submodule-repo
repository, I added this command to the build instructions:
steps:
- name: gcr.io/cloud-builders/git
args: ['submodule', 'update', '--init', '--recursive']
...
And it fail in this stage. Why? permissions problem:
Submodule 'XXX' (XXX) registered for path '***' Cloning into '/workspace/XXX'... ssh: Could not resolve hostname c: Name or service not known fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
The read permission I gave Google is for the main-repo
git repository. Since I can give access only for one repository, I can't give another permission for the submodule-repo
repsoitory.
How I can use Google Cloud Build to build an git repository with git sub-module?