Jenkins Git plugin with https

后端 未结 11 2257
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

提交回复
热议问题