Push sources checked out from Gerrit to Git on jenkins Job using pipeline

7 views
Skip to first unread message

Dominic Espiritu

unread,
Jan 14, 2020, 12:19:48 AM1/14/20
to Jenkins Users
Hi,

I would just like to ask if possible to push updates from my Gerrit repository to Git repository using SCM in jenkins? I only tried doing this on a manual steps from my terminal window, Any suggestions would be a good help.

Thanks,
Dominic

Björn Pedersen

unread,
Jan 14, 2020, 2:15:20 AM1/14/20
to Jenkins Users
Hi,

Checkout from the source with scm and just add a shell step that does the push. Per default the scm implementation also will use the installed commandline git client.
If you need credentials for the push, you can wrap the shell step in a withCredentials.

But maybe just using the gerrit replication instead could be  a better option.

Björn

Dominic Espiritu

unread,
Jan 14, 2020, 2:28:34 AM1/14/20
to jenkins...@googlegroups.com
Hi Björn Pedersen,

Thanks for the reply, I will try the first approach you mentioned, I might also take a look at the gerrit replication feature in the future since I have one repository that is modified completely in gerrit 
and should not be synced with my Git, Im just wondering of its possible with a wrapper withCredentials to just provide the credentialsId without the username and password since in my jenkins global credentials its already stored my username with password?

Thanks,
Dominic


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/2e89c015-febc-4381-a923-fcb08013433d%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages