美文网首页
jenkins获取添加的gitlabApiToken

jenkins获取添加的gitlabApiToken

作者: 87d6dc4b11a7 | 来源:发表于2022-06-23 15:44 被阅读0次
    import com.cloudbees.plugins.credentials.CredentialsProvider
    def credsList = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials(com.cloudbees.plugins.credentials.Credentials.class,Jenkins.instance,null,null);
    def creds = credsList.findResult { it.id == "<YOUR-CREDS-ID>" ? it : null }
    println("apiToken: ${creds.apiToken}")
    

    参考:https://issues.jenkins.io/browse/JENKINS-48552
    https://github.com/jenkinsci/gitlab-plugin/issues/536

    相关文章

      网友评论

          本文标题:jenkins获取添加的gitlabApiToken

          本文链接:https://www.haomeiwen.com/subject/wimevrtx.html