[solved] Secrets not getting populates

Hi,
I am trying to use secrets in 0.5 version of drone. I have used secrets specific to the repo and global

GuessWho➜  core : feat/drone.io ✔ :✭ ᐅ  drone -version
drone version 0.5.0+dev
GuessWho➜  core : feat/drone.io ✔ :✭ ᐅ   drone secret ls Revature/core
REVATUREBOT_TOKEN
Images: quay.io/naveensrinivasan/jnlp-slave:0.9
Events: push, tag, deployment
SkipVerify: false
Conceal: false

PASSWORD
Images: busybox
Events: push, tag, deployment
SkipVerify: true
Conceal: false

GuessWho➜  core : feat/drone.io ✔ :✭ ᐅ   cat .drone.yml
pipeline:
  build:
    image: busybox
    commands:
      - printenv
      - echo $PASSWORD
GuessWho➜  core : feat/drone.io ✔ :✭ ᐅ  drone global secret ls
PASSWORD
Images: busybox
Events: push, tag, deployment
SkipVerify: true
Conceal: false

And here is the build output

+ printenv
DRONE_NETRC_MACHINE=github.com
DRONE_BRANCH=Dev
DRONE_COMMIT_AUTHOR_AVATAR=https://avatars.githubusercontent.com/u/172697?v=3
DRONE_JOB_FINISHED=0
CI=drone
DRONE_VERSION=0.5.0+822
HOSTNAME=80609e82df61
DRONE_COMMIT_AUTHOR=naveensrinivasan
DRONE_REPO_LINK=https://github.com/Revature/core
DRONE_PREV_BUILD_NUMBER=29
SHLVL=2
DRONE_COMMIT_BRANCH=Dev
HOME=/root
DRONE_REPO_SCM=git
DRONE_REPO_PRIVATE=true
DRONE_BUILD_STATUS=success
DRONE_ARCH=linux/amd64
DRONE_PREV_COMMIT_SHA=71817e40c6a4e19c66e5da3efefd865f70252100
DRONE_COMMIT_MESSAGE=Using  drone.io for CI
DRONE_REPO_BRANCH=Dev
DRONE_YAML_VERIFIED=true
DRONE_REMOTE_URL=https://github.com/Revature/core.git
DRONE_JOB_STATUS=running
DRONE_COMMIT_REFSPEC=feat/drone.io:Dev
DRONE_REPO_OWNER=Revature
DRONE=true
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
DRONE_BUILD_NUMBER=30
DRONE_BUILD_STARTED=0
DRONE_BUILD_LINK=http://drone.revatureengineering.com/Revature/core/30
DRONE_REPO_TRUSTED=true
DRONE_YAML_SIGNED=true
DRONE_COMMIT=36b112f7ebeac1aaed29dd10b227282d3d75c6da
SHELL=/bin/sh
DRONE_PULL_REQUEST=744
DRONE_JOB_STARTED=1482633328
DRONE_JOB_NUMBER=1
DRONE_BUILD_EVENT=pull_request
DRONE_BUILD_CREATED=1482633328
DRONE_COMMIT_AUTHOR_EMAIL=nsrinivasan1976@gmail.com
DRONE_JOB_EXIT_CODE=0
DRONE_REPO_NAME=core
DRONE_COMMIT_SHA=36b112f7ebeac1aaed29dd10b227282d3d75c6da
DRONE_COMMIT_REF=refs/pull/744/merge
DRONE_PREV_BUILD_STATUS=success
DRONE_REPO_AVATAR=https://avatars.githubusercontent.com/u/17991371?v=3
PWD=/drone/src/github.com/Revature/core
DRONE_COMMIT_LINK=https://github.com/Revature/core/pull/744
DRONE_BUILD_FINISHED=0
DRONE_REPO=Revature/core
+ echo $PASSWORD

I would have expected password to have a value but it is not. In my Yaml I am trying to echo it using $PASSWORD but there is nothing in the output.

But where as when I run this command locally drone exec -secret PASSWORD=naveen I can see the password in the echo output.

What am I missing?

Thanks

Take a look at troubleshooting tips in this comment https://github.com/drone/drone/issues/1727#issuecomment-247104764

1 Like

Thank you! That helped a lot!