Having issues creating a plugin in bash

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

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.

got it, thanks for the info