File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ class DeploysController < ShipitController
1010 def new
1111 @commit = @stack . commits . by_sha! ( params [ :sha ] )
1212 @commit . checks . schedule if @stack . checks?
13- @deploy = @stack . build_deploy ( @commit , current_user )
13+ @deploy = @stack . build_deploy ( @commit , current_user , force : params [ :force ] . present? )
1414 end
1515
1616 def show
@@ -25,7 +25,7 @@ def create
2525 @until_commit ,
2626 current_user ,
2727 env : deploy_params [ :env ] ,
28- force : params [ :force ] . present? ,
28+ force : params [ :force ] . present? || deploy_params [ :ignored_safeties ] . present? ,
2929 )
3030 respond_with ( @deploy . stack , @deploy )
3131 rescue Task ::ConcurrentTaskRunning
@@ -62,7 +62,11 @@ def load_until_commit
6262 end
6363
6464 def deploy_params
65- @deploy_params ||= params . require ( :deploy ) . permit ( :until_commit_id , env : @stack . deploy_variables . map ( &:name ) )
65+ @deploy_params ||= params . require ( :deploy ) . permit (
66+ :until_commit_id ,
67+ :ignored_safeties ,
68+ env : @stack . deploy_variables . map ( &:name ) ,
69+ )
6670 end
6771
6872 def previous_successful_deploy_commit ( task )
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ module Shipit
22 module StacksHelper
33 def redeploy_button ( deployed_commit )
44 commit = UndeployedCommit . new ( deployed_commit , index : 0 )
5- url = new_stack_deploy_path ( commit . stack , sha : commit . sha )
5+ url = new_stack_deploy_path ( commit . stack , sha : commit . sha , force : bypass_safeties? )
66 classes = %W( btn btn--primary deploy-action #{ commit . state } )
77
88 unless commit . stack . deployable?
@@ -17,7 +17,7 @@ def bypass_safeties?
1717 end
1818
1919 def deploy_button ( commit )
20- url = new_stack_deploy_path ( commit . stack , sha : commit . sha )
20+ url = new_stack_deploy_path ( commit . stack , sha : commit . sha , force : bypass_safeties? )
2121 classes = %W( btn btn--primary deploy-action #{ commit . state } )
2222 deploy_state = commit . deploy_state ( bypass_safeties? )
2323 data = { }
Original file line number Diff line number Diff line change 2222
2323 < section class ="submit-section ">
2424 <%= f . hidden_field :until_commit_id %>
25+ <%= f . hidden_field :ignored_safeties %>
2526 <%= f . submit class : 'btn btn--primary btn--large trigger-deploy' %>
2627 </ section >
2728 <% end %>
You can’t perform that action at this time.
0 commit comments