fatal: could not read Username for, No such device

前端 未结 1 768
借酒劲吻你
借酒劲吻你 2021-01-17 11:45

In my Jenkins job, I am configuring git in the following way:

sh(\"git config user.email my.email@google.com\")
sh(\"git config user.name my-user-name\")
sh(         


        
相关标签:
1条回答
  • 2021-01-17 12:17

    You're looking for credential.username. I don't know about the passphrase, but if you dislike http://username:password@my-git-repo.com:8000 then put the credentials in your Jenkinsfile like so:

    The second most common type of Credentials is "Username and Password" which can still be used in the environment directive, but results in slightly different variables being set.

    environment {
       SAUCE_ACCESS = credentials('sauce-lab-dev')
    }
    

    This will actually set 3 environment variables:

    SAUCE_ACCESS containing <username>:<password>
    SAUCE_ACCESS_USR containing the username
    SAUCE_ACCESS_PSW containing the password
    

    credentials is only available for Declarative Pipeline. For those using Scripted Pipeline, see the documentation for the withCredentials step.

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