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:
/cloudbuild.yaml
as a build configThe 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
You can write the build config file using the YAML or the JSON syntax. If you submit build requests using third-party http tools such as curl, use the JSON syntax. Note: If you're using VS Code or IntelliJ IDEs, you can use Cloud Code to author your YAML config files.
How do you configure Cloud Build to rebuild your image when a change is made to the source code? Add a Cloud Build trigger, and set it to fire on commit to associate repository. Add a Cloud Build function, and set it to fire on commit to associate repository.
I don't think what you want is possible. I don't think this part can work: - name: 'some kind of command that runs cloudbuild.yaml'
The best thing might be simply filing a feature request with our issue tracker that will allow you to reference "module_1/cloudbuild.yaml" directly as a configuration.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With