本文介绍了詹金斯(Jenkins)的“触发远程构建" > “认证令牌";缺少选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚正在使用Nginx在反向代理后面设置Jenkins(最新版本-2.5),以便我可以通过HTTPS访问它.

I have just been working on setting up Jenkins (latest - 2.5) behind a reverse proxy with Nginx so that I can access it over HTTPS.

它正在工作,但是我的Multibranch Pipeline作业在主配置中不再具有远程生成触发器"选项.我认为我没有更改任何其他配置.任何想法发生了什么以及如何找回它?

It's working, however my Multibranch Pipeline jobs no longer have the "Trigger Builds Remotely" option in the main config. I don't think I changed any other configurations. Any ideas what happened and how to get it back?

这就是我想要的东西:

推荐答案

经过一段时间的搜索,我认为我可以自信地回答自己的问题.

After some time and searching around, I think I am able to answer my own question with some confidence.

我相信答案就在于安全设置.身份验证令牌的目的是允许未经授权的用户(开发人员)触发构建而无需登录Jenkins(请参阅 https://wiki.jenkins-ci.org/display/JENKINS/Authenticating+scripted+clients https://wiki.jenkins-ci.org/display/JENKINS/Quick+and+Simple+Security ).

I believe the answer lies within the security settings. The purpose of the Authentication Token is to allow unauthorized users (developers) to trigger a build without having login access to Jenkins (see https://wiki.jenkins-ci.org/display/JENKINS/Authenticating+scripted+clients and https://wiki.jenkins-ci.org/display/JENKINS/Quick+and+Simple+Security).

因此,如果您使用的是基于矩阵的安全性(在配置全局安全性" >>授权"下),则触发远程构建"选项将消失,因为假定您将使用Jenkins用户帐户对请求进行身份验证

So if you are using Matrix-based security (under "Configure Global Security" >> Authorization), then the "Trigger builds remotely" option will go away because it is presumed that you will be authenticating requests using a Jenkins user account.

为此,您可以使用用户名/密码(甚至更好的用户名/API令牌)发出HTTP请求:

In order to do that you can make an HTTP request with the username/password (or even better username/API Token):

curl -X POST "https://username:api-token@JENKINS_URL/job/Example/build"

这篇关于詹金斯(Jenkins)的“触发远程构建" > “认证令牌";缺少选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 02:30