Using Jenkins with a private BitBucket Git repository

前端 未结 3 815
余生分开走
余生分开走 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: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.

提交回复
热议问题