diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-09-18 16:12:13 +0900 |
---|---|---|
committer | Alessio Caiazza <acaiazza@gitlab.com> | 2018-10-02 17:02:11 +0200 |
commit | 1a6a59d6bc3ab2fc43cd3537ef9d8deea7398cc9 (patch) | |
tree | 4df02e9f3520742deedcdbeefde1eee61ca35a4a | |
parent | 22e00b08e89f72eb0fefea2d1d623667c4461773 (diff) | |
download | gitlab-ce-1a6a59d6bc3ab2fc43cd3537ef9d8deea7398cc9.tar.gz |
Add unschedule endpont to job controller
-rw-r--r-- | app/controllers/projects/jobs_controller.rb | 7 | ||||
-rw-r--r-- | config/routes/project.rb | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/app/controllers/projects/jobs_controller.rb b/app/controllers/projects/jobs_controller.rb index 3f85e442be9..d4a0af6f0f9 100644 --- a/app/controllers/projects/jobs_controller.rb +++ b/app/controllers/projects/jobs_controller.rb @@ -110,6 +110,13 @@ class Projects::JobsController < Projects::ApplicationController redirect_to build_path(@build) end + def unschedule + return respond_422 unless @build.scheduled? + + @build.unschedule + redirect_to build_path(@build) + end + def status render json: BuildSerializer .new(project: @project, current_user: @current_user) diff --git a/config/routes/project.rb b/config/routes/project.rb index 8a5310b5c23..04a270c5cc9 100644 --- a/config/routes/project.rb +++ b/config/routes/project.rb @@ -275,6 +275,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do member do get :status post :cancel + post :unschedule post :retry post :play post :erase |