wisetc / practice

Practice conclusion
5 stars 0 forks source link

关于 gitlab pipelines/schedules 定时不准问题 #35

Open wisetc opened 4 years ago

wisetc commented 4 years ago

image

gitlab 的 schedules 功能,你会发现,无论怎么设置 Schedule Cron,最后定时的分钟都是 19。这样,设定的时间便不精确。

可以通过修改配置文件 gitlab.rb 的 pipeline_schedule_worker_cron 的值为设定的值,例如 "0 * * * *",然后执行 reconfigure,这样,每次的分钟数就变成了 0.

假设使用 gitlab 使用 docker 来部署,容器名为 gitlab-container。

$ sudo docker exec -it gitlab-container bash
# vim /etc/gitlab/gitlab.rb
# # 修改 pipeline_schedule_worker_cron 的值 为 "0 * * * *"
# gitlab-ctl reconfigure

这个问题很恼人,因为预期跟实际太不一样了,而且没有 gitlab 一个好的支持。

参考: