I’m trying to enable SSH access and therefore, I need to run a custom bash script which is in root of my git repo. I took help from Drone’s custom logic docs, and use this script:
from what I can tell you have disabled the default clone step, but are trying to invoke scripts/drone-ssh-key.sh before the repository is cloned. As a result, scripts/drone-ssh-key.sh does not exist yet. So this seems expected.
@bradrydzewski I need to invoke the scripts/drone-ssh-key.sh before cloning the repo, because it adds my pvt keys so that I can clone through git+ssh (git:url/repo)
Where does DRONE_PRIVATE_SSH_KEY come from? I do not see anywhere in your yaml that instructs Drone to load this environment variable into the step.
Also, I just tried cloning the repo first with git+http
Why are you not using the default clone step? Perhaps it would be more prudent to try to troubleshoot why the default clone does not work for you, instead of troubleshooting this complex and non-standard workaround?
I’ve referred to this doc link and injected the secret into env. My secrets are being loaded and Keys are also getting added. My yaml file looks something like this now…
git@172.19.0.2: Permission denied (publickey,keyboard-interactive).
17 fatal: Could not read from remote repository.
18
19 Please make sure you have the correct access rights
20 and the repository exists.