【发布时间】:2019-11-29 15:01:43
【问题描述】:
我在 Jenkins 管道中使用 with Credential 来全局使用屏蔽凭证
node(){
withCredentials([usernamePassword(credentialsId: '6827ae64-c211-4bb9-b4cd-64eeca90be6f', passwordVariable: 'PASSWORD', usernameVariable: 'USERNAME')])
但如果我正在使用
def username
def password
node(){
withCredentials([usernamePassword(credentialsId: '6827ae64-c211-4bb9-b4cd-64eeca90be6f', passwordVariable: 'PASSWORD', usernameVariable: 'USERNAME')]) {
username = USERNAME
password = PASSWORD
}
我可以在控制台输出中看到凭据。我们有什么方法可以加密这个东西并使其安全。
【问题讨论】:
-
答案在那里^^使用掩码密码插件
标签: jenkins github azure-devops jenkins-pipeline