the docs show how to set a file to a secret envvar http://readme.drone.io/0.5/secrets/
is there a convenient way to do the opposite? e.g. have this ssh key be available in .ssh/id_rsa with all the correct permissions.
And by "convienient" I obviously mean without having to type mkdir
, >
or chmod
If you want to use an ssh key as part of your build, you can add the ssh key to the secret store using the following command:
Note that the
@
notation is similar to curl. The reason this feature exists is because creating the secret usingcat
(or some other sort of pipe) seems to cause a malformed file to upload.Once the file is added, you can reference in your Yaml:
Note that it is important to cat
SSH_KEY
inside quotes in order to preserve new lines.You may also need to add the host to
known_hosts
in order to prevent host key issues; changebitbucket.org
to whatever host you're pulling from in the following, and add it tocommands
(after the command shown above, to ensure that the/root/.ssh
directory exists):(You'll also need to install openssh-client or equivalent, if it's not already available in your build image.)
nope