9f93395389
When the owner of a pipelines schedule was either blocked or was removed from the project, the pipeline schedular would still schedule the pipeline. This would than fail however, given the user had no access to the project and it contents. However, a better way to handle it would be to not schedule it at all. Furthermore, from now on, such schedules will be deactivated so the schedule worker can ignore it on the next runs.
2.2 KiB
2.2 KiB
Pipeline Schedules
Note
:
- This feature was introduced in 9.1 as [Trigger Schedule][ce-105533]
- In 9.2, the feature was renamed to Pipeline Schedule
Pipeline schedules can be used to run pipelines only once, or for example every month on the 22nd for a certain branch.
Using Pipeline Schedules
In order to schedule pipelines, navigate to your their pages Pipelines ➔ Schedules and click the New Schedule button.
After entering the form, hit Save Schedule for the changes to have effect. You can check a next execution date of the scheduled trigger, which is automatically calculated by a server.
Taking ownership
Pipelines are executed as a user, which owns a schedule. This influences what projects and other resources the pipeline has access to. If a user does not own a pipeline, you can take ownership by clicking the Take ownership button. The next time a pipeline is scheduled, your credentials will be used.
Notes:
- Those pipelines won't be executed precicely. Because schedules are handled by
Sidekiq, which runs according to its interval. For exmaple, if you set a schedule to
create a pipeline every minute (
* * * * *
) and the Sidekiq worker performs 00:00 and 12:00 o'clock every day (0 */12 * * *
), only 2 pipelines will be created per day. To change the Sidekiq worker's frequency, you have to edit thetrigger_schedule_worker_cron
value in yourgitlab.rb
and restart GitLab. The Sidekiq worker's configuration on GiLab.com is able to be looked up at here. - Cron notation is parsed by Rufus-Scheduler.
- When the owner of the schedule does not have the ability to create pipelines anymore, due to e.g. being blocked or removed from the project, the schedule is deactivated. Another user can take ownership and activate it, so the schedule is run again.