Jenkins Git plugin with https

后端 未结 11 2213
Happy的楠姐
Happy的楠姐 2020-12-30 05:20

I am trying to configure a Git project in Jenkins using the Git plugin. In the project configuration page I enter the repository URL in the Git configuration, which is an ht

相关标签:
11条回答
  • 2020-12-30 05:35

    You can register your git credentials in "Credentials" with your login and password to access the git repository by https protocol (below of "Manage Jenkins"), it will generate a credentialId (e.g. dd0d6733-cc2e-4464-bb7d-4b6af86fe40a) that helps Jenkins to use this credential in pipelines.

    When you use Jenkins Pipeline, you can do:

    node{
        git url: "https://tfs:8080/tfs/job.git", branch: "feature/migration", credentialsId:'dd0d6733-cc2e-4464-bb7d-4b6af86fe40a'
    }
    

    It will download your source codes to the job's workspace

    0 讨论(0)
  • 2020-12-30 05:35

    This is now fixed and no more an issue with up to date plugin (as I'm writing this 1.19.0). It happened with git-plugin-client 1.6.x.

    0 讨论(0)
  • 2020-12-30 05:37

    In my case, one Jenkins slave worked normally, while another did not. When I changed the Git executable from default to JGit, they both worked.

    0 讨论(0)
  • 2020-12-30 05:37

    My solution did works well for Jenkins-Git-Plugin.

    # create my exec
    su root
    darngit=/usr/bin/darngit
    touch $darngit
    echo "#! /usr/bin/env bash" > $darngit
    echo "git -c sslVerify=false $@" > $darngit
    

    Goto system setting, set git executable = /usr/bin/darngit

    0 讨论(0)
  • 2020-12-30 05:42

    using git:// instead of https:// works for me on jenkins 1.644 with git client 1.19.6

    0 讨论(0)
  • 2020-12-30 05:44

    I tried all stuff to get rid of certificate issue but then finally it is issue with git plugin. I roll back plugins to git 1.5 (from 2.0.3) and git-client 1.0.7 (from 1.6.3) and it worked find. Note that I tried git-client 1.4.6 first so that I can use credential option but it didn't work. So I think correct combination of these 2 plugins are important. This solution was mentioned at JENKINS-20533

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