git credentials

 

https://*.com/questions/38461705/checkout-jenkins-pipeline-git-scm-with-credentials

withCredentials([usernamePassword(credentialsId: '<credentials-id>', passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) {
    sh '''
        printf "machine github.com\nlogin $GIT_USERNAME\n password $GIT_PASSWORD" >> ~/.netrc
        // continue script as necessary working with git repo...
    '''
}
上一篇:LeetCode-279. 完全平方数


下一篇:shiro认证加密流程