Secret problems

this syntax will never work because it is not escaped and is therefore subject to pre-processing. See https://docs.drone.io/pipeline/environment/syntax/

you therefore need to do this:

pipeline:
  docker:
    image: docker
    secrets: [ sonar_host ]
    commands:
-   - "echo ${SONAR_HOST}"
+   - echo $${SONAR_HOST}

or if you just want to inspect variables do this:

pipeline:
  docker:
    image: docker
    secrets: [ sonar_host ]
    commands:
-   - "echo ${SONAR_HOST}"
+   - env

I really need to expose all my secrets to environment variable so my custom plugin can do the following:

all secrets are always exposed as environment variables without exception, when they are configured correctly. If a secret is not being exposed it is because of configuration error. We have documented common reasons for secrets not working here: http://docs.drone.io/secrets-not-working/