无人机克隆工作不开火

发布于 2025-02-01 16:48:35 字数 466 浏览 4 评论 0原文

我使用以下命令

cron add-Branch Master“ foo/bar”“ avery-5-mins”“ 0 */5 * * * * * * * * * *”

当我看UI时,我可以看到创建了Cron的作业。但是,即使我在无人机yaml文件中定义了它,它也不会发射。

- name: cron-job
  pull: if-not-exists
  image: foo-image
  commands:
    - *random
    - echo "I am testing a cron job"
  when: &cron-demo
    event:
      - cron
    cron:
      - every-5-mins

需要做其他事情以使其按计划工作吗?

而且,是否有一种手动触发Cron工作的方法?我似乎在文档中找不到任何东西。

I've created a cron job in Drone CI using the following command

drone cron add --branch master "foo/bar" "every-5-mins" "0 */5 * * * *"

And when I look in the UI, I can see the cron job has been created. However, it doesn't fire, even though I have it defined in my drone yaml file.

- name: cron-job
  pull: if-not-exists
  image: foo-image
  commands:
    - *random
    - echo "I am testing a cron job"
  when: &cron-demo
    event:
      - cron
    cron:
      - every-5-mins

Does something else need to be done to get it to work on schedule?

And also, is there a way to manually trigger a cron job? I can't seem to find anything in the docs.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

吾性傲以野 2025-02-08 16:48:35

您可能会发现这很有帮助。

https://docs.drone.io/api/cron/cron_trigger/

基本上,您需要的就是这样。

curl -X POST -H "Authorization: Bearer $DRONE_TOKEN" "$DRONE_SERVER/api/repos/foo/bar/cron/every-5-mins"

You might find this helpful.

https://docs.drone.io/api/cron/cron_trigger/

Basically, what you need is something like this.

curl -X POST -H "Authorization: Bearer $DRONE_TOKEN" "$DRONE_SERVER/api/repos/foo/bar/cron/every-5-mins"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文