Drone injects secrets as environment variables. There is a parameter you can use to source build arguments from environment variables. You can therefore do this:
This looks great and seems to be working. Couple questions though
If I try to execute my build locally with drone exec then I can’t use the ssh key, because only the part until the first space gets into the id_rsa file (-----BEGIN) - on our drone server though the whole key is in the file. Is this a know issue with the cli?
with the build running on the server the logs include the whole key as part of the docker build command’s --build-arg parameter value. I saw there is a conceal feature, but not sure how to make that work. Any thoughts on this?
The conceal feature does not work for multi-line secrets. I presume the key is to clone private dependencies? You could always clone your dependencies outside of your Dockerfile and include using the ADD directive.
Alternatively you can always fork the Docker plugin and customize it. Plugins are intentionally easy to fork, customize and then substitute in your yaml file.