Private git submodule not found in Jenkins Private git submodule not found in Jenkins jenkins jenkins

Private git submodule not found in Jenkins


Solved. In my credential I was using a direct SSH key (option "Enter directly"), instead of putting into a file.

I've just put the keys (public and private) in ~/.ssh, and changed my credentials to the option "From the Jenkins master ~/.ssh".

The problem was that the submodule wasn't using the credential that I've specified to the main repository, it was trying to use the default ssh key (.ssh/id_rsa).

Another solution is to pass -i my_key to the git submodule step (only need this if your key isn't in the default path (~/.ssh/id_rsa) )

Also don't forget to give the correct permissions to your keys, in my case I had to:

chown apache ~/.ssh/id_rsa*chmod 700 ~/.ssh/id_rsa*