我可以安排一次在Jenkins中运行的构建吗?没有cron的任何解决方案 [英] Can I schedule a build for onetime run in Jenkins ? Any solution without cron
本文介绍了我可以安排一次在Jenkins中运行的构建吗?没有cron的任何解决方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我不需要cron作业,因为该构建只需要在生产中运行一次,而不必定期运行.是否有一种方法可以在计划的时间构建不使用cron的管道.
I don't need cron job because the build is needed to run only once in production and not periodically.Is there a way to build the pipeline at a scheduled time without cron.
推荐答案
一种方法是-您可以远程触发它 https://www.jenkins.io/doc/book/using/remote-access-api/
One way to do is - You can trigger it remotely https://www.jenkins.io/doc/book/using/remote-access-api/
假设您有一个Linux机器,则可以通过使用"at"按钮来安排它.命令
Let's say you got a Linux box, you can schedule it by using the "at" command
at 9:30 PM Fri
curl -X POST JENKINS_URL/job/JOB_NAME/build \
--data token=TOKEN \
--data-urlencode json='{"parameter": [{"name":"id", "value":"123"},\
{"name":"verbosity", "value":"high"}]}'
job 2 at Fri Jan 29 21:30:00 2016
然后用
at -c 2
这篇关于我可以安排一次在Jenkins中运行的构建吗?没有cron的任何解决方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文