Using Jenkins with a private BitBucket Git repository

前端 未结 3 797
余生分开走
余生分开走 2021-02-01 04:21

When setting up a project in Jenkins that\'s hosted on bitbucket what would I put in the URL field?

The repository is private.

相关标签:
3条回答
  • 2021-02-01 04:51

    Please make sure GIT is installed and path is configured in Jenkins. To configure path have a look at the link Jenkins could not run git

    I am able to connect private repository using credentials in Jenkins. To connect using ssh please follow the youtube link Private repositories, GitHub & BitBucket

    0 讨论(0)
  • 2021-02-01 04:55

    I'm not familiar with Jenkins but Bitbucket allows you to clone git repositories over https which can accept the password as part of the url, like so:

    https://<user>:<pass>@bitbucket.org/<user>/<project>.git
    
    0 讨论(0)
  • 2021-02-01 04:57

    For this purpose I switched over to using the SSH protocol to talk to BitBucket. By doing this I was able to set up a private/public key pair, with the private key on my Jenkins build machine, and the public key added to my account on BitBucket. SSH can then be set up to authenticate based on this key pair.

    A word of warning, if your Jenkins machine is windows based, I'd avoid using plink/TortoisePLink as the SSH agent, and instead use OpenSSH from Cygwin as it is a lot faster when cloning/updating large repositories. It was a little tricky to set this up at first, but would probably warrant a separate Stack Overflow question if required.

    0 讨论(0)
提交回复
热议问题