title: access environment variables of drone in drone plugins
body: <p>I am completely new to drone CI/CD. I am facing issue on passing environment variables to drone plugin. What i did upto now is</p>
  
  <ul>
  <li>I deployed drone docker image drone/drone:0.7 in one of my server (my.drone.com) (both server and agent working. bitbucket is integrated successfully) I followed this article: <a href="https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-drone-on-ubuntu-16-04" rel="nofollow noreferrer">configre drone on ubuntu</a> for setup.</li>
  <li>I activated one of my repo for CI/CD in drone admin app</li>
  <li>I added <code>.drone.yml</code> file to project</li>
  <li>I did setup automatic image build in <code>cloud.docker.com</code> app. Now i want to deploy that image to my other cloud server (<code>my.app.com</code>). So,  I added applebody/drone-ssh to drone.yml to access that server</li>
  <li>For this plugin to deploy to my server, it needs to access my server (<code>my.app.com</code>) through ssh.</li>
  <li>I can login to <code>my.app.com</code> from <code>my.drone.com</code> server</li>
  <li>But i dont know how plugin can access my.app.com, I tried to pass my <code>my.drone.com</code> <strong>private ssh key</strong> to plugin through environment varibles. But didn't workout. my drone's server and agent env file and <code>.drone.yml</code> as follows:</li>
  </ul>
  
  <p><strong>.drone.yml</strong></p>
  
  <p><code>
      pipeline:
        ssh:
          image: appleboy/drone-ssh
          host: my.app.com
          user: root
          key: $PLUGIN_SSH_KEY
          script:
            - ls
            - cd apps
            - docker pull drprasad/todo-app
            - docker rm -f todo
            - docker run -p 8080:8080 -d --name 'todo' drprasad/todo-app
         notify:
           image: plugins/slack
           webhook: https://hooks.slack.com/services/token
           channel: test
           username: drone-is-flying
  </code></p>
  
  <p><strong>agent env file</strong></p>
  
  <pre><code>DRONE_SECRET=my_drone_secret_key
  DRONE_SERVER=ws://drone-server:8000/ws/broker
  PLUGIN_SSH_KEY="-----BEGIN RSA PRIVATE KEY-----
  MIIEpAIBAAKCAQEAzMW5gU9I071UdnBDANbvuprd+1QwBEXWUq0gvi44ECUDZhzL
  ...............................................................
  ...............................................................
  -----END RSA PRIVATE KEY-----"
  </code></pre>
  
  <p><strong>server env</strong></p>
  
  <pre><code>DRONE_SECRET=my_drone_secret_key
  DRONE_HOST=my.drone.com:8082
  DRONE_OPEN=true
  DRONE_BITBUCKET=true
  DRONE_BITBUCKET_CLIENT=my_bitbucket_client_token
  DRONE_BITBUCKET_SECRET=my_bitbucket_secret_key
  PLUGIN_SSH_KEY="-----BEGIN RSA PRIVATE KEY-----
  MIIEpAIBAAKCAQEAzMW5gU9I071UdnBDANbvuprd+1QwBEXWUq0gvi44ECUDZhzL
  ...............................................................
  ...............................................................
  -----END RSA PRIVATE KEY-----"
  </code></pre>
  
  <p>How can pass <code>PLUGIN_SSH_KEY</code> variable (either from agent or server env file) to drone plugin ?? so that it can access my <code>my.app.com</code> server</p>
  
  <p>Even I dont know my approach is correct or not. Please correct me if my approach is wrong. </p>
  
  <p>Sorry for my bad english. <strong>Thanks</strong></p>