{"action":"opened","issue":{"url":"https://api.github.com/repos/drone-plugins/drone-ssh/issues/11","repository_url":"https://api.github.com/repos/drone-plugins/drone-ssh","labels_url":"https://api.github.com/repos/drone-plugins/drone-ssh/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/drone-plugins/drone-ssh/issues/11/comments","events_url":"https://api.github.com/repos/drone-plugins/drone-ssh/issues/11/events","html_url":"https://github.com/drone-plugins/drone-ssh/issues/11","id":169743347,"number":11,"title":"How to pass custom environment variables into plugins","user":{"login":"euclid1990","id":5584709,"avatar_url":"https://avatars.githubusercontent.com/u/5584709?v=3","gravatar_id":"","url":"https://api.github.com/users/euclid1990","html_url":"https://github.com/euclid1990","followers_url":"https://api.github.com/users/euclid1990/followers","following_url":"https://api.github.com/users/euclid1990/following{/other_user}","gists_url":"https://api.github.com/users/euclid1990/gists{/gist_id}","starred_url":"https://api.github.com/users/euclid1990/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/euclid1990/subscriptions","organizations_url":"https://api.github.com/users/euclid1990/orgs","repos_url":"https://api.github.com/users/euclid1990/repos","events_url":"https://api.github.com/users/euclid1990/events{/privacy}","received_events_url":"https://api.github.com/users/euclid1990/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-06T11:52:45Z","updated_at":"2016-08-06T11:52:45Z","closed_at":null,"body":"#### I faced this problem when custom plugins\r\n\r\nStep 1: I have forked this repo: https://github.com/drone-plugins/drone-ssh\r\nStep 2: I run followings command to build `/drone-ssh` binary\r\n```\r\nexport GO15VENDOREXPERIMENT=1\r\nGOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -tags netgo\r\n```\r\nStep 3: I built docker image with command: `docker build -t euclid1990/drone-ssh .`\r\nStep 4: I have been configured my `.drone.yml` in my source code with custom image/plugins:\r\n```\r\ndeploy:\r\n  ssh:\r\n    image: euclid1990/drone-ssh\r\n    host: 108.61.186.xxx\r\n    user: root\r\n    port: 22\r\n    sleep: 5\r\n    commands:\r\n      - echo hello\r\n```\r\nStep 5: I run drone exec in local to test: `drone exec --deploy  -i ~/.ssh/id_rsa`\r\nBut it echo below errors:\r\n```\r\n[DRONE] starting job #1\r\nError: Can't connect without a private SSH key.\r\n[info] build failed (exit code 1)\r\n[DRONE] finished job #1\r\n[DRONE] exit code 1\r\n[DRONE] job #1 failed\r\n[DRONE] build failed\r\n```\r\n\r\nIt seem not pass Drone `PLUGIN_KEY=\"$(cat ${HOME}/.ssh/id_rsa)\" \\` into custom ssh-plugin ? How can I read private key of drone in custom plugin ?"}}
{"actor":{"display_login":"euclid1990"}}