Closed scriptnull closed 2 years ago
The way things are being done right now is that we have a custom checkout hook in our plugin which handles the checkout by taking the information from the configuration(url
and ref
). But, according to buildkite documentation for the checkout
hook, if there are multiple checkout hooks present then only the first one is run.
So the solution suggested above will be hard to implement, since each will create a separate checkout hook but only the first would be run. I would suggest that we do it something like smooth-secrets where an array of secrets configuration(secrets
) is provided under the same plugin definition. So it would look something like this
steps:
- command: echo "Checks out multiple repositories"
plugins:
- hasura/smooth-checkout#v2.0.0:
repos:
- config:
- url: git@git-mirror.internal:<username>/<reponame1>.git
- url: git@github.com:<username>/<reponame1>.git
- config:
- url: git@github.com:<username>/<reponame2>.git
ref: main
Ah! Nice catch about the usage of multiple checkout hooks. The YAML that you proposed looks good. (additionally, it may help us to re-use our mirroring logic to the fullest) :+1: :shipit:
We should probably allow something like having two smooth-checkout section or perhaps somehow give the config in a single plugin call to provide multiple repositories for cloning (note: in case of the second case we will need to think about mirrors implementation we already have and not break it)