Reputation: 19
I have a jenkins pipeline project which does the checkout from my github repository as shown below Jenkins pipeline SCM
Any changes updated in my github repository should be reflected in github repository of another account with the same folder strcuture using Jenkins pipeline. Got any ideas on how to proceed with this?
I have attached my pipeline script and the console output in the following images
Upvotes: 0
Views: 336
Reputation: 1324278
Assuming your other GitHub repository:
You could make your pipeline do a git push "withCredentials", as in here.
withCredentials([usernamePassword(credentialsId: 'fixed',
usernameVariable: 'username',
passwordVariable: 'password')]){
sh("git push http://$username:[email protected]/repo")
}
See "Credentials Binding Plugin": you can use variable or dsecret file for the password.
Upvotes: 1