diff options
author | g0t mi1k <have.you.g0tmi1k@gmail.com> | 2023-02-24 00:38:53 +0100 |
---|---|---|
committer | gregor herrmann <gregoa@debian.org> | 2023-02-24 00:38:53 +0100 |
commit | d414f7bc2a4a65ed7a6943f24706685c8a740ac3 (patch) | |
tree | 8f3efa6b907a45efdc6124aed56f482eb1c1c64c | |
parent | 8608f6d820ea3d5f184d87fdd093d7605f35eda0 (diff) |
Using GitLab's API v4, it is possible to manually run a scheduled pipeline job.
Last-Update: Mon, 23 Jan 2023 05:28:26 +0000
Forwarded: https://github.com/bluefeet/GitLab-API-v4/pull/55
REF: https://docs.gitlab.com/ee/api/pipeline_schedules.html#run-a-scheduled-pipeline-immediately
Forwarded: https://github.com/bluefeet/GitLab-API-v4/pull/55
Gbp-Pq: Name 0001-add-run_pipeline_schedule.patch
-rw-r--r-- | author/sections/pipeline_schedules.yml | 1 | ||||
-rw-r--r-- | lib/GitLab/API/v4.pm | 20 |
2 files changed, 21 insertions, 0 deletions
diff --git a/author/sections/pipeline_schedules.yml b/author/sections/pipeline_schedules.yml index 71eeb30..2d7b76d 100644 --- a/author/sections/pipeline_schedules.yml +++ b/author/sections/pipeline_schedules.yml @@ -4,6 +4,7 @@ - create_pipeline_schedule: schedule = POST projects/:project_id/pipeline_schedules? - edit_pipeline_schedule: schedule = PUT projects/:project_id/pipeline_schedules/:pipeline_schedule_id? - take_ownership_of_pipeline_schedule: schedule = POST projects/:project_id/pipeline_schedules/:pipeline_schedule_id/take_ownership +- run_pipeline_schedule: variable = POST projects/:project_id/pipeline_schedules/:pipeline_schedule_id/play - delete_pipeline_schedule: schedule = DELETE projects/:project_id/pipeline_schedules/:pipeline_schedule_id - create_pipeline_schedule_variable: variable = POST projects/:project_id/pipeline_schedules/:pipeline_schedule_id/variables? - edit_pipeline_schedule_variable: variable = PUT projects/:project_id/pipeline_schedules/:pipeline_schedule_id/variables/:variable_key? diff --git a/lib/GitLab/API/v4.pm b/lib/GitLab/API/v4.pm index 1d65d33..d5ba9ab 100644 --- a/lib/GitLab/API/v4.pm +++ b/lib/GitLab/API/v4.pm @@ -7086,6 +7086,26 @@ sub take_ownership_of_pipeline_schedule { return $self->_call_rest_client( 'POST', 'projects/:project_id/pipeline_schedules/:pipeline_schedule_id/take_ownership', [@_], $options ); } +=item run_pipeline_schedule + + my $variable = $api->run_pipeline_schedule( + $project_id, + $pipeline_schedule_id, + ); + +Sends a C<POST> request to C<projects/:project_id/pipeline_schedules/:pipeline_schedule_id/play> and returns the decoded response content. + +=cut + +sub run_pipeline_schedule { + my $self = shift; + croak 'run_pipeline_schedule must be called with 2 arguments' if @_ != 2; + croak 'The #1 argument ($project_id) to run_pipeline_schedule must be a scalar' if ref($_[0]) or (!defined $_[0]); + croak 'The #2 argument ($pipeline_schedule_id) to run_pipeline_schedule must be a scalar' if ref($_[1]) or (!defined $_[1]); + my $options = {}; + return $self->_call_rest_client( 'POST', 'projects/:project_id/pipeline_schedules/:pipeline_schedule_id/play', [@_], $options ); +} + =item delete_pipeline_schedule my $schedule = $api->delete_pipeline_schedule( |