Improve code design

This commit is contained in:
Kamil Trzcinski 2016-07-18 18:42:03 +02:00
parent f08eb7bbb7
commit f12faae8b8
3 changed files with 4 additions and 8 deletions

View File

@ -49,18 +49,14 @@ class Projects::BuildsController < Projects::ApplicationController
end
def retry
unless @build.retryable?
return render_404
end
return render_404 unless @build.retryable?
build = Ci::Build.retry(@build, current_user)
redirect_to build_path(build)
end
def play
unless @build.playable?
return render_404
end
return render_404 unless @build.playable?
build = @build.play(current_user)
redirect_to build_path(build)

View File

@ -1,5 +1,5 @@
class Gitlab::Seeder::Builds
STAGES = %w(build notify_build test notify_test deploy notify_deploy)
STAGES = %w[build notify_build test notify_test deploy notify_deploy]
def initialize(project)
@project = project

View File

@ -530,7 +530,7 @@ The above script will:
1. Execute `cleanup_build_job` only when `build_job` fails
2. Always execute `cleanup_job` as the last step in pipeline
3. Allow you to manually execute `deploy_job` form GitLab
3. Allow you to manually execute `deploy_job` from GitLab
#### Manual actions