New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Help Debug why secrets don't work #1727
Comments
|
Nice command. |
|
Until we have this command available to help locally debug how and when secrets are injected, hopefully this will help people debug issues with secrets not being injected. OverviewThis will discuss common reasons secrets are not injected or are not working as expected. The overwhelming majority of issues with secrets are user error, so please read carefully and double check your work. Known IssuesThere is only one known bug with secrets related to signing the yaml file on Windows machines. If you use Windows and would like to help resolve this issue please see #1662 Image mismatchWhen you add a secret you need to provide a list docker image(s) that the secret can be exposed to. The list of images must be an exact match to what is in your yaml, or must use matching logic. Let's use this yaml as an example: These command will expose secrets: These commands will not expose secrets: Note that if you are using tags in the image name, they need to be taken into account when you specify the These commands will expose secrets Pull RequestsFor security reasons Drone will not expose secrets for pull request events. If you want secrets exposed to pull requests it needs to be enabled when adding the secret: Invalid or Missing SignatureFor security reasons, Drone will not expose secrets unless the yaml is signed and that signature matches the contents of the yaml. If the yaml file changes, the signature needs to be updated. If you don't have a If you have a Malformed Secrets from FileWhen loading secrets from file, such as ssh keys, we recommend using the Injection is DeprecatedPlease note that Drone 0.5 changes how secrets are provided to your build steps. You may no longer inject secrets using the Instead Drone 0.5 will pass your secrets (ie pipeline:
publish:
image: plugins/docker
- username: $$DOCKER_USERNAME |
|
Thanks, here is a sample file https://github.com/naveensrinivasan/drone-test/blob/master/.drone.yml Here is the output for my global secrets And I am still not getting output for Here is the output from the build And it is working when I pass the secret locally Please let me know how I could add secrets. I have tried following command and none of them have solved my issue
|
|
Based on the CLI output, |
|
closing since secret impl changes to interpolate using |
With 0.5 secrets are a bit more complex than prior versions and I propose we provide some utilities to help individuals understand how they work and debug. Sort of a like a sql explain plan, I propose a
drone secret explaincommand.The command could look like this:
Example output could look like this:
It is also possible that we could run the explain plan on the Yaml parsing and compiling itself to show how it is transformed. This might be even more helpful but will be way more difficult and involved.
The text was updated successfully, but these errors were encountered: