Checkout Jenkins Pipeline Git SCM with credentials?

后端 未结 6 1704
情深已故
情深已故 2020-12-04 08:20

I was following this tutorial:

node {
  git url: \'https://github.com/joe_user/simple-maven-project-with-tests.git\'
  ...
}

However it doe

6条回答
  •  半阙折子戏
    2020-12-04 08:45

    If you want to use ssh credentials,

      git(
           url: 'git@github.com.git',
           credentialsId: 'xpc',
           branch: "${branch}"
        )
    

    if you want to use username and password credentials, you need to use http clone as @Serban mentioned.

        git(
           url: 'https://github.com/.git',
           credentialsId: 'xpc',
           branch: "${branch}"
        )
    

提交回复
热议问题