是否有可能在不到一个小时内安排 gitlab 管道?
Is it possible to schedule gitlab pipeline in less than an hour?
我尝试设置一个每 20 分钟运行一次的预定管道。我在设置中使用了自定义的 cron 语法 (*/20 * * * *
),但 gitlab 不支持这一点,仍然每小时运行一次。
这是一个 gitlab 错误还是我遗漏了什么?
查看 GitLab schedules:它确实提到:
The pipelines won't be executed precisely, because schedules are handled by Sidekiq, which runs according to its interval.
For example, if you set a schedule to create a pipeline every minute (* * * * *
) and the Sidekiq worker runs on 00:00 and 12:00 every day (0 */12 * * *
), only 2 pipelines will be created per day.
To change the Sidekiq worker's frequency, you have to edit the pipeline_schedule_worker_cron
value in your gitlab.rb
and restart GitLab.
12 的新方法。8.X
要更改 Sidekiq worker 的频率:
在实例的 gitlab.rb 文件中编辑 gitlab_rails['pipeline_schedule_worker_cron'] 值。
我从 gitlab.rb 文件中检查的确切行是
# gitlab_rails['pipeline_schedule_worker_cron'] = "19 * * * *"
所以取消注释该行,例如 运行 每分钟都这样做。
gitlab_rails['pipeline_schedule_worker_cron'] = "* * * * *"
重新配置 GitLab 以使更改生效。
然后去工作并将其添加到您的工作计划中,在本例中它将每 5 分钟 运行 :
*/5 * * * *
旧版本10.x.x 好的方法是。
在实例的 gitlab.rb 文件中编辑 gitlab_ci['schedule_builds_minute'] = "0" 值。
请查看官方页面,它经常更改
https://docs.gitlab.com/ce/user/project/pipelines/schedules.html#advanced-configuration
我尝试设置一个每 20 分钟运行一次的预定管道。我在设置中使用了自定义的 cron 语法 (*/20 * * * *
),但 gitlab 不支持这一点,仍然每小时运行一次。
这是一个 gitlab 错误还是我遗漏了什么?
查看 GitLab schedules:它确实提到:
The pipelines won't be executed precisely, because schedules are handled by Sidekiq, which runs according to its interval.
For example, if you set a schedule to create a pipeline every minute (
* * * * *
) and the Sidekiq worker runs on 00:00 and 12:00 every day (0 */12 * * *
), only 2 pipelines will be created per day.To change the Sidekiq worker's frequency, you have to edit the
pipeline_schedule_worker_cron
value in yourgitlab.rb
and restart GitLab.
12 的新方法。8.X
要更改 Sidekiq worker 的频率: 在实例的 gitlab.rb 文件中编辑 gitlab_rails['pipeline_schedule_worker_cron'] 值。 我从 gitlab.rb 文件中检查的确切行是
# gitlab_rails['pipeline_schedule_worker_cron'] = "19 * * * *"
所以取消注释该行,例如 运行 每分钟都这样做。
gitlab_rails['pipeline_schedule_worker_cron'] = "* * * * *"
重新配置 GitLab 以使更改生效。 然后去工作并将其添加到您的工作计划中,在本例中它将每 5 分钟 运行 :
*/5 * * * *
旧版本10.x.x 好的方法是。 在实例的 gitlab.rb 文件中编辑 gitlab_ci['schedule_builds_minute'] = "0" 值。
请查看官方页面,它经常更改 https://docs.gitlab.com/ce/user/project/pipelines/schedules.html#advanced-configuration