Connecting From Jenkins to Git Repository such as Gitlab, without Plugins

Basically all you need is your repository url, username and password.

First is adding your git username and password on Jenkins credentials,

And after that, we can create a username and password credentials, and we give an id with the name of “devops”.

Use this jenkins script to execute git commands,

node('maven') {
	stage('Clone') {
		sh "git config --global http.sslVerify false"
		git branch:"branch-01", url:"https://git.mygit.id/git/something/project.git", credentialsId:'devops'
	}
}
Google+

No Comments

Leave a Comment

Please be polite. We appreciate that.
Your email address will not be published and required fields are marked


:-[ (B) (^) (P) (@) (O) (D) :-S ;-( (C) (&) :-$ (E) (~) (K) (I) (L) (8) :-O (T) (G) (F) :-( (H) :-) (*) :-D (N) (Y) :-P (U) (W) ;-)