I am trying to setup Jenkins with BitBucket GIT repository, but the Jenkins console always gives me this error code:
Started by user Dakado
Building in workspace
Your issue is right here :
Fetching upstream changes from git://bitbucket.org/GameTeamCZ/gtplaytime.git
FATAL: Failed to fetch from git://bitbucket.org/GameTeamCZ/gtplaytime.git
Is your repository public or private ? If it is private, then there is 2 ways to connect to your Repo :
First using login/password
https://**login:password**@bitbucket.org/GameTeamCZ//gtplaytime.git
Second using CREDENTIALS Refer to that page to setup credentials for your Jenkins server : https://confluence.atlassian.com/display/BITBUCKET/Set+up+SSH+for+Git
Then you can use a command like that to login to your repository:
git@CREDENTIALS:TEAM/REPO.git
This is worked for me: You need to create App Password on Bitbucket
(1) go to BitBucket Setting-> Access Manaegment-> App passwords-> Repositories (select options here whatever you want to accomplish)
(2) Jenkins -> Credentials-> Jenkins-> Global credentials (unrestricted) -> Add Credentials -> Kind "Username with password" provide here user/password here
(3) Go to your Jenkins Jobs -> GIT ->
Repository URL : https://USER_NAME@bitbucket.org/ABCcompany/myRepo.git
Credentials: select from dropdown You just created
Resources: Bitbucket, Jenkins, Selenium, Chrome
Increasing the clone time works for me. My clone was terminating as the file was too large and required more time to fetch the code from the repository and the default timeout is set at 10 minutes. Hence, increasing the limit from 10 to a larger time limit worked for me. Go to the job > Configure > Source Code Management > click on Add Additional Behaviours > select Advanced Clone Behaviour > set 'Timeout (in minutes) for clone and fetch operations' to 100. and check on Shallow Clone with depth 1. Check the attached image for more clarity here - JENKINS configuration for clone behaviour