How to make use of secret in Drone template
Let’s say you have a usecase, “How to use secrets inside a template?”. Then how do we achieve this?
-
Templates themselves don’t have secret capabilities, and You would have to reference secrets that are available to the resulting pipeline in one of the supported secret features.
-
You can find more information on how to make use of secrets in drone here: Secrets | Drone
-
You can use secrets at different scopes, like Per Repository, and Per Organization. The organization secrets could then be referenced in the template (templates are also specific to the organization), and the runner would access the secrets at pipeline execution time.
-
You can find more information on using per repository secrets here: Per Repository | Drone Repository secrets are used to store and manage sensitive information, such as passwords, tokens, and ssh keys. Storing this information in secret is considered safer than storing it in your configuration file in plain text.
-
You can find more information on using per Organization secrets here: Per Organization | Drone Organization secrets are used to store and manage sensitive information, such as passwords, tokens, and ssh keys. Storing this information in secret is considered safer than storing it in your configuration file. Organization secrets can be used by any repository that belongs to the named organization.
So this is how you can use secrets in a drone template.