# Having issues creating a plugin in bash

**URL:** <https://drone.discourse.group/t/having-issues-creating-a-plugin-in-bash/7573>\
**Category:** Drone Support\
**Created:** [July 23, 2019, 8:36pm UTC](https://drone.discourse.group/t/having-issues-creating-a-plugin-in-bash/7573 "2019-07-23T20:36:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jpdentone](https://avatars.discourse-cdn.com/v4/letter/j/51bf81/32.png) [@jpdentone](https://drone.discourse.group/u/jpdentone)\
**Post date:** [July 23, 2019, 8:36pm UTC](https://drone.discourse.group/t/having-issues-creating-a-plugin-in-bash/7573/1 "2019-07-23T20:36:21Z")

</div>

so I need to add the id\_rsa into the plugin so it can download private repos; I know I can do it using commands but I would rather have the yml file somehow clean

this is what im doing

drone.yml  
- name: test  
image: some/image:latest  
settings:  
sshprivatekey:  
from\_secret: SSH\_PRIVATE\_KEY  
commands:  
- cat /root/.ssh/id\_rsa

in dockerfile

```
ADD test.sh /bin/test.sh
RUN chmod +x /bin/test.sh
ENTRYPOINT ["/bin/test.sh"]

```

the test.sh script

```
#!/bin/sh
mkdir /root/.ssh/

echo "${PLUGIN_SSHPRIVATEKEY}" > /root/.ssh/id_rsa
chmod 600 /root/.ssh/id_rsa

```

the result: it fails

```
+ cat /root/.ssh/id_rsa
cat: /root/.ssh/id_rsa: No such file or directory

```

any ideas what could be the issue?

thanks in advance

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [July 23, 2019, 8:40pm UTC](https://drone.discourse.group/t/having-issues-creating-a-plugin-in-bash/7573/2 "2019-07-23T20:40:00Z")

</div>

you cannot use `commands` with a plugin. When you use `commands` it overrides the images default entrypoint. In this case, because you override the entrypoint with commands, test.sh never gets executed and the file never gets generated.

---

<div class="post-metadata">

**Author:** ![jpdentone](https://avatars.discourse-cdn.com/v4/letter/j/51bf81/32.png) [@jpdentone](https://drone.discourse.group/u/jpdentone)\
**Post date:** [July 24, 2019, 9:39pm UTC](https://drone.discourse.group/t/having-issues-creating-a-plugin-in-bash/7573/3 "2019-07-24T21:39:59Z")

</div>

got it, thanks for the info
