简体   繁体   English

Jenkins Trigger 远程构建

[英]Jenkins Trigger builds remotely

Im trying to use Jenkins Trigger builds remotely.我正在尝试远程使用 Jenkins Trigger 构建。

I have set up the my API token at MY USER -> configure -> API Token.我已经在我的用户 -> 配置 -> API 令牌中设置了我的 API 令牌。

At my job i have set Trigger builds remotely (eg, from scripts) and passed MY_TOKEN value there.在我的工作中,我已远程设置触发器构建(例如,从脚本)并在那里传递 MY_TOKEN 值。

Now when i try to run the job via cURL call bellow, the python script that should receive the exposed arguments via sys.argv[] is not receiving the parameters sent on the cURL call as below.现在,当我尝试通过下面的 cURL 调用运行作业时,应该通过 sys.argv[] 接收公开参数的 python 脚本没有接收在 cURL 调用上发送的参数,如下所示。

If i run the job manualy providing the arguments as jenkins string parameters it runs smooth, receiving the arguments fine.如果我手动运行作业,将参数作为 jenkins 字符串参数提供,它运行顺利,接收参数很好。

curl -X POST JENKINS_URL/JOB/buildWithParameters  --user MY_USER:MY_TOKEN  --data-urlencode json='{"parameter": [{"name":"folder", "value":"\\\\1234\\123\\12\\1\\"}, {"name":"schema", "value":"source"}]}'

You should send build parameters individually as bellow您应该如下单独发送构建参数

curl -X POST JENKINS_URL/JOB/buildWithParameters  --user MY_USER:MY_TOKEN \
 --data folder="\\\\1234\\123\\12\\1\\" \
 --data schema="source"
curl -I -u deepusiXXXXXXXX:TOKEN https://jenkins-devops.com/job/testing_pipeline/buildWithParameters?token=abcd1234&BUILDNO=762

-u提供用户名:从 jenkins 生成的令牌。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Jenkins 与 Jenkinsfile 管道 - 远程触发构建 - Jenkins with Jenkinsfile Pipeline - Trigger Builds Remotely 触发 Jenkins 通过 Groovy 脚本远程构建 - Trigger Jenkins builds remotely via Groovy script 何时在jenkins中远程使用触发器构建 - when to use trigger builds remotely in jenkins 如何远程触发Jenkins构建并传递参数 - How to trigger Jenkins builds remotely and to pass parameters 如何使用带参数的URL远程触发Jenkins构建 - How to trigger Jenkins builds remotely using URL with parameters Jenkins“远程触发构建”>“身份验证令牌”选项丢失 - Jenkins “Trigger builds remotely” > “Authentication Token” option missing 在詹金斯远程触发构建 - Triggering builds remotely in Jenkins 您可以使用 Jenkins 远程触发以在您的存储库中运行脚本吗(该脚本与构建无关) - Can you remotely trigger to run scripts in your repo with Jenkins (the script is not related to builds) Google App Engine,Google Cloud Console,Jenkins触发器远程构建,未找到gcloud命令 - Google App Engine, Google Cloud Console, Jenkins trigger builds remotely, gcloud command not found 在Jenkins中安装Build Token Root Plugin后,不会出现“远程触发构建” - “Trigger builds remotely” does not appear after installing Build Token Root Plugin in Jenkins
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM