0

I want to add an ssh key to my drone secrets, but can't get the command to work. I've tried many versions of the command found on various stackoverflow/documentation pages, but none of them work. The command help also gives an entirely different syntax than the one in the documentation...

From the documentation:

drone secret add \
  --repository <registry> \
  --image <image> \
  --name <name> \
  --value <value>

This just doesn't work for me.

Then I've found this Stackoverflow question about adding ssh keys to secrets. The answer shows again a different syntax, I tried this way, still doesn't work.

When I try to use the command, I get this:

Incorrect Usage.

NAME: drone secret add - adds a secret

USAGE: drone secret add [command options] [repo] [key] [value]

OPTIONS: --event [--event option --event option] inject the secret for these event types --image [--image option --image option] inject the secret for these image types --input input secret value from a file --skip-verify skip verification for the secret --conceal conceal secret in build logs

Which suggests it should be used like this:

drone secret add user/repo SSH_KEY <my_id_rsa>

But that doesn't work either.

So what's the actual way of using this command?

nialna2
  • 2,056
  • 2
  • 25
  • 33
  • FYI there is an example in the docs (toward the bottom of the page) that shows how to upload a secret from file. `drone secret add -repository octocat/hello-world -name ssh_key -value @/root/ssh/id_rsa` – Brad Rydzewski Sep 03 '17 at 03:56

1 Answers1

0

Turns out there is an option to add secrets in the web interface, in the settings page of a repo. I completely missed it and the documentation doesn't mention it.

So no need to use the command line.

nialna2
  • 2,056
  • 2
  • 25
  • 33