Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Submodules in blueocean?

I have a blue ocean project which grabs a git project using an ssh key, I added new shell commands but it doesn't pull the submodules in the .gitsubmodules folder:

[submodule "Assets/Engine"]
    path = Assets/Engine
    url = [email protected]:22/Game/_ssh/Engine
    branch = "master"
[submodule "Assets/PlatformerModule/Extension"]
    path = Assets/PlatformerModule/Extension
    url = [email protected]:22/Game/_ssh/PlatformerModule
    branch = "master"

I tried adding shell commands for git submodule init and git submodule update but it fails on gitsubmodule update due to authentication:

Cloning into '/Users/Shared/Jenkins/Home/workspace/Platform_master-6J2EI5MV24CJ5OZMBARB5I3D276FBUM4RTXAZNAML5SYUAR7S3YA/Assets/Le'... Permission denied, please try again. Permission denied, please try again. [email protected]: Permission denied (password,publickey). fatal: Could not read from remote repository.

I also tried adding the 'advanced submodule step' in the git scm plugin to no avail.

Is there a way to make sure it uses the correct ssh key for those updates as well?

like image 824
meds Avatar asked Feb 07 '18 15:02

meds


Video Answer


1 Answers

Is there a way to make sure it uses the correct ssh key for those updates as well?

Yes, using the JENKINS SSH Credentials Plugin, you can copy the private key in that plugin, and use the associated credential for the Git repo job setting, which will make any ssh call using said private key.
This supposes a recent enough (2016) version of the Jenkins Git client.
As seen here, you can use credentials from default remote of parent repository in the Advanced sub-modules behaviours settings.

like image 189
VonC Avatar answered Oct 10 '22 01:10

VonC