We’re exploring the idea of using drone inside of drone for our monorepo, to have the ability to define a
.drone.yml file at the root of each service.
To do so, the main
.drone.yml at the root of the repo will download the
drone-cli and will run
drone exec ./path/to/service/.drone.yml.
workspace: base: /go path: src/github.com/org/repo pipeline: test: image: docker commands: - docker ps - apk --update add curl - curl -L https://github.com/drone/drone-cli/releases/download/v1.0.7/drone_linux_amd64.tar.gz | tar zx && install -t /usr/local/bin drone - /usr/local/bin/drone --version - /usr/local/bin/drone exec ./path/to/service/.drone.yml volumes: - /var/run/docker.sock:/var/run/docker.sock
And the service
.drone.yml could look like:
workspace: base: /go path: src/github.com/org/repo/path/to/service pipeline: test: image: golang commands: - go test ./...
Unfortunately this is not working, and after multiple attempts with different flags (
--volume) setting/unsetting docker.sock volume from all
.drone.yml, we keep getting the following error:
> drone version 1.0.7 > Error response from daemon: invalid mount config for type "bind": bind source path does not exist: /go/src/github.com/org/repo
This error comes after the drone version got displayed, meaning the drone install is correct and the error is raised by the
drone exec command.
Any idea what we might be missing? Any concern regarding this idea of drone inside of drone? Is it actually possible? I couldn’t find any drone plugins with this particular behavior, the closer being https://github.com/drone-plugins/drone-downstream I suppose, but that’s actually not the same thing