hi, when we clone the tree, we use “git clone --recursive git@github.com:XXX”
But when we run it in digitalocean-runner, it won’t recursively checkout, is there a way to configure git clone to do recursive checkout? The command is “git checkout --recurse-submodules”
I tried to add
git submodule init
git submodule update
into a build step but I don’t have access to git at that point. the error is:
Host key verification failed.
40 fatal: Could not read from remote repository.
Host key verification failed.
40 fatal: Could not read from remote repository.
It sounds like you are trying to recursively clone private repositories. Have you installed an SSH key in the temporary home directory that is created for you pipeline [1]?
the syntax in your example is using a mix of syntax from Drone 0.8 and Drone 1.0 which is why it does not work. Specifically, the clone section is from 0.8 and is invalid syntax. I therefore recommend looking at the official docs mentioned above.
The links and suggestions @ashwilliams1 provided above are the recommended solutions for Drone 1.0 and higher. Any contradicting links you find are probably for 0.8 or below and are outdated, and may not work with 1.0 or higher. You will also note the drone-plugins/drone-git is deprecated and archived, and is no longer used in versions 1.0 or higher.
We removed recursive cloning from Drone 1.0 because there was no one-size-fits-all solution when it came to authentication or path rewrites. We decided it was best to give each project the flexibility to handle this directly in their pipeline. Specifically, most projects define submodules using git+ssh and require ssh authentication. Drone uses git+https and basic authentication which means changing runner-go will not solve your authentication problem and you would still receive errors. Since this was intentionally removed, and because it was difficult to design and support a single solution that would satisfy all use cases, I do not envision it be re-added to runner-go.
Your best option is to add the below configuration to your yaml, or to create a custom plugin to handle recursive cloning. For example: