Cloning additional repos

I’m trying to clone additional repos that my project depends on. I noticed that this example was given here in Evaluating Drone vs. others

pipeline:
  setup:
   image: docker:git
   commands:
     - git clone https://github.com/foo/bar.git
     - git clone https://github.com/foo/baz.git
     - git clone https://github.com/foo/qux.git

and this works, but doesn’t allow me to take advantage of netrc credentials, etc. I was wondering if using plugins/git might instead be used for this. Something like:

pipeline:
  foo:
    image: plugins/git
    remote: https://github.com/foo/bar.git
    path: /work/bar

However, it seems that passing remote and path to the plugins/git image doesn’t override the variables that drone sets during its implicit clone step. Any suggestions for this use case? Thanks!

the netrc credentials are used by any https git clone. So the below example will use the netrc file, assuming your repository is private which is a pre-requisite for drone to expose the credentials to your pipeline.

pipeline:
  setup:
   image: docker:git
   commands:
     - git clone https://github.com/foo/bar.git
     - git clone https://github.com/foo/baz.git
     - git clone https://github.com/foo/qux.git
1 Like

Be careful not to call the step “clone”. I think it is a reserved word and no error are given. Simply all the steps are skipped.