Reputation: 213
I created a .gitlab-ci.yml file in my Git project and I would like it to run every 5 minutes.
I created a new schedule in gitlab.com ( CI/ CD -> schedules -> new schedule) and used custom Interval Pattern with the pattern - * /5 * * * *
But this is not working, I saw that the pipeline run every hour and not every 5 minutes as I expected.
I used the pipeline schedules documentation
and I saw that maybe the reason is that schedules are handled by
Sidekiq and I need to edit gitlab.rb file -
I can't find what is this "gitlab.rb file", I tried to created it manually in my project, and tried to put this file in my project under etc/gitlab/, and this not working for me.
Please help me with this issue, if you know what I should do about the gitlab.rb file or do you have another idea of how to run ci/cd every 5 minutes.
Thank you!
Upvotes: 4
Views: 2801
Reputation: 387
In my case I ended up used an API call in a crontab to start schedule task every minute. Before the task was starting every 5 or 10 minutes even if set to start every minute.
Works perfectly.
Upvotes: 0
Reputation: 3026
As you've found in the docs, how frequently a schedule is run is partially determined by the cron.
By default, the cron is run on the 19th minute of every hour, which means, it won't run more than once an hour unless the default has been changed.
The gitlab.rb
file that needs to be edited is part of the GitLab installation (as the other poster mentioned), so you would either need to follow the configuration instructions to edit the file, or talk to whomever is the GitLab administrator for the instance you're using to change it.
For reference, the GitLab.com settings page lists the cron frequency for the SaaS version of GitLab.
Upvotes: 5
Reputation: 2220
gitlab.rb
file is part of Gitlab installation, i.e. not part of the project.
Upvotes: 1