My project is split into gitmodules like so:
/ +
|
+-module_1
| |
| +- cloudbuild.yaml
| +- src/
| +-.git/
|
+-module_2
| |
| +- cloudbuild.yaml
| +- src/
| +-.git/
|
+- .git/
+- .gitmodules
+- cloudbuild.yaml
I'm trying to build submodules from parent repository, but cloudbuild has a problem with that, as it does not fetch gitmodules by itsself. So when I reference module_1/cloudbuild.yaml
as a cloudbuild configuration the build fails because this file does not exist. I'm thinking about possilbe workarounds and i'd like to ask if the following is possible:
- referencing
/cloudbuild.yaml
as a build config - adding a step to fetch gitmodules in cloudbuild.yaml
- Run a different cloudbuild file
The result should look something like:
steps:
- name: 'gcr.io/$PROJECT_ID/git'
args: ['submodule', 'update', '--init']
- name: 'some kind of command that runs cloudbuild.yaml`
args: ['module_1/cloudbuild.yaml']
Disclaimer I'm aware that I can just place all the cloudbuild configs inside the root repository, but I'd like the modules to be as much self-governing as possible