Secrets are unavailable when using drone deploy

Hi,

Using latest drone (0.8)

I noticed that when using drone deploy secrets are not exposed to the job.
I’m running this command:
drone deploy <repo> <build_number> <environment> -p PACKAGE=<some_package>
Maybe the fact that I’m using a parameter for the deploy somehow creates an issue?

When using the deploy directly, everything works fine.
I noticed a similar problem but it seems that --local is the problem there, prbably unrelated to this:

Am I missing something?

Secrets are available to deployment events by default. You can verify your secret configuration from the command line or from the secret management screen:

Secret needs to be configured correctly (as always)

pipeline:
  build:
    image: golang:1.8
    secrets: [ PASSWORD ]
    commands:
      - echo $DRONE_BUILD_EVENT
      - echo $PASSWORD

At which point they will be available to your build. Below is a screenshot from a real build (latest version of drone) that demonstrates the secret is indeed available to deployments.

We have a document for troubleshooting why secrets are not working [1] as well as the minimum required debug information that we need in order to answer these type of support questions [2].

[1] http://docs.drone.io/secrets-not-working/
[2] http://docs.drone.io/secrets-not-working/#still-having-trouble

1 Like

Thank you Brad!

Upgrading from a previous 0.8 (rc3) I had secrets defined only for push, I think that was the default behaviour before.
Anyway, I’ve redefined the secret now.

Thanks again, you’re awesome.