Uncategorized Posts

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+