我可以安排一次构建在 Jenkins 中运行吗?没有 cron 的任何解决方案 [英] Can I schedule a build for onetime run in Jenkins ? Any solution without cron

查看:14
本文介绍了我可以安排一次构建在 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆