Submodule_override in the clone stage on Drone 0.7

I’m using Drone 0.7, and I want to be able to use the submodule_override option to stop the Host key verification failed. fatal: Could not read from remote repository. error you get from submodules. The API around customizing clone seems to have shifted a lot, so I’m not certain how to go about this.

I first tried the clone-outside-pipeline syntax, but this failed with
ERROR: yaml: unmarshal errors: line 1: cannot unmarshal !!strplugins…into yaml.Container:

clone:
    image: plugins/git
    recursive: true
    submodule_override:
        my_submodule: https://github.com/my/submodule

pipeline:
    build:
        image: test_image
        commands:
            - dx build_asset . -f

And I tried the clone-inside-pipeline syntax, which ran fine, but the submodule_override seemed to have no effect, and I got the Could not read from remote repository error:

pipeline:
    clone:
        image: plugins/git
        recursive: true
        submodule_override:
            my_submodule: https://github.com/my/submodule
    build:
        image: test_image
        commands:
            - dx build_asset . -f

What should I be doing?

The clone stage should indeed be placed outside of the pipeline, per the docs:
http://docs.drone.io/cloning/

The clone section in your example (outside of the pipeline) is not using the correct hierarchy. The following change would produce a valid yaml:

clone:
-   image: plugins/git
-   recursive: true
-   submodule_override:
-       my_submodule: https://github.com/my/submodule
+   default:
+     image: plugins/git
+     recursive: true
+     submodule_override:
+         my_submodule: https://github.com/my/submodule

pipeline:
  ...

Thanks! Can you explain what this top-level key, underneath clone (in your case, default) indicates? Should I always use default?

But, using the default key, as you describe above, works perfectly, thank you!

The clone section and pipeline section are the same data structure. That is to say, the clone section can have one or many named steps. In the example I provided, default is just an arbitrary name for the step. You can rename as needed.