From dcc89f12384cfc0095cbf51840c7d2c2fc859fdf Mon Sep 17 00:00:00 2001 From: Dosuken shinya Date: Fri, 21 Apr 2017 11:18:30 +0000 Subject: Add doc for scheduled trigger --- app/views/projects/triggers/_form.html.haml | 2 +- doc/ci/triggers/README.md | 28 +++++++++++++++++++++ doc/ci/triggers/img/trigger_schedule_create.png | Bin 0 -> 34264 bytes doc/ci/triggers/img/trigger_schedule_edit.png | Bin 0 -> 18524 bytes .../img/trigger_schedule_updated_next_run_at.png | Bin 0 -> 21896 bytes 5 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 doc/ci/triggers/img/trigger_schedule_create.png create mode 100644 doc/ci/triggers/img/trigger_schedule_edit.png create mode 100644 doc/ci/triggers/img/trigger_schedule_updated_next_run_at.png diff --git a/app/views/projects/triggers/_form.html.haml b/app/views/projects/triggers/_form.html.haml index 8582bcbb8cc..70d654fa9a0 100644 --- a/app/views/projects/triggers/_form.html.haml +++ b/app/views/projects/triggers/_form.html.haml @@ -19,7 +19,7 @@ %strong Schedule trigger (experimental) .help-block If checked, this trigger will be executed periodically according to cron and timezone. - = link_to icon('question-circle'), help_page_path('ci/triggers', anchor: 'schedule') + = link_to icon('question-circle'), help_page_path('ci/triggers/README', anchor: 'using-scheduled-triggers') .form-group = schedule_fields.label :cron, "Cron", class: "label-light" = schedule_fields.text_field :cron, class: "form-control", title: 'Cron specification is required.', placeholder: "0 1 * * *" diff --git a/doc/ci/triggers/README.md b/doc/ci/triggers/README.md index e380282f910..5f611314d09 100644 --- a/doc/ci/triggers/README.md +++ b/doc/ci/triggers/README.md @@ -227,3 +227,31 @@ branch of project with ID `9` every night at `00:30`: ``` [ci-229]: https://gitlab.com/gitlab-org/gitlab-ci/merge_requests/229 + +## Using scheduled triggers + +> [Introduced][ci-10533] in GitLab CE 9.1 as experimental. + +In order to schedule a trigger, navigate to your project's **Settings ➔ CI/CD Pipelines ➔ Triggers** and edit an existing trigger token. + +![Triggers Schedule edit](img/trigger_schedule_edit.png) + +To set up a scheduled trigger: + +1. Check the **Schedule trigger (experimental)** checkbox +1. Enter a cron value for the frequency of the trigger ([learn more about cron notation](http://www.nncron.ru/help/EN/working/cron-format.htm)) +1. Enter the timezone of the cron trigger ([see a list of timezones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)) +1. Enter the branch or tag that the trigger will target +1. Hit **Save trigger** for the changes to take effect + +![Triggers Schedule create](img/trigger_schedule_create.png) + +You can check a next execution date of the scheduled trigger, which is automatically calculated by a server. + +![Triggers Schedule create](img/trigger_schedule_updated_next_run_at.png) + +> **Notes**: +- Those triggers won't be executed precicely. Because scheduled triggers are handled by Sidekiq, which runs according to its interval. For exmaple, if you set a trigger to be executed every minute (`* * * * *`) and the Sidekiq worker performs 00:00 and 12:00 o'clock every day (`0 */12 * * *`), then your trigger will be executed only 00:00 and 12:00 o'clock every day. To change the Sidekiq worker's frequency, you have to edit the `trigger_schedule_worker` value in `config/gitlab.yml` and restart GitLab. The Sidekiq worker's configuration on GiLab.com is able to be looked up at [here](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/gitlab.yml.example#L185). +- Cron notation is parsed by [Rufus-Scheduler](https://github.com/jmettraux/rufus-scheduler). + +[ci-10533]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/10533 diff --git a/doc/ci/triggers/img/trigger_schedule_create.png b/doc/ci/triggers/img/trigger_schedule_create.png new file mode 100644 index 00000000000..3cfdc00b7a7 Binary files /dev/null and b/doc/ci/triggers/img/trigger_schedule_create.png differ diff --git a/doc/ci/triggers/img/trigger_schedule_edit.png b/doc/ci/triggers/img/trigger_schedule_edit.png new file mode 100644 index 00000000000..647eac0a5d0 Binary files /dev/null and b/doc/ci/triggers/img/trigger_schedule_edit.png differ diff --git a/doc/ci/triggers/img/trigger_schedule_updated_next_run_at.png b/doc/ci/triggers/img/trigger_schedule_updated_next_run_at.png new file mode 100644 index 00000000000..71d08d04c37 Binary files /dev/null and b/doc/ci/triggers/img/trigger_schedule_updated_next_run_at.png differ -- cgit v1.2.1