Skip to content

Commit

Permalink
Adds CAB acknowledgment to production deployment. (#2247)
Browse files Browse the repository at this point in the history
  • Loading branch information
bwatson78 authored Feb 9, 2024
1 parent c57dfd0 commit d193392
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 16 deletions.
40 changes: 24 additions & 16 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@ AllCops:
- node_modules/**/*
- lib/tasks/sample_data.rake

Layout/HashAlignment:
EnforcedColonStyle: table

Layout/IndentationConsistency:
EnforcedStyle: indented_internal_methods

Layout/LineLength:
Exclude:
- app/importers/curate_record_importer.rb
- spec/importers/curate_mapper_spec.rb

Lint/NonLocalExitFromIterator:
Exclude:
- app/importers/collection_permission_ensurer.rb

Metrics/AbcSize:
Exclude:
- app/controllers/background_jobs_controller.rb
Expand Down Expand Up @@ -64,21 +79,6 @@ Metrics/CyclomaticComplexity:
- config/initializers/bulkrax.rb
- config/initializers/file_actor.rb

Layout/HashAlignment:
EnforcedColonStyle: table

Layout/IndentationConsistency:
EnforcedStyle: indented_internal_methods

Layout/LineLength:
Exclude:
- app/importers/curate_record_importer.rb
- spec/importers/curate_mapper_spec.rb

Lint/NonLocalExitFromIterator:
Exclude:
- app/importers/collection_permission_ensurer.rb

Metrics/MethodLength:
Exclude:
- app/controllers/background_jobs_controller.rb
Expand Down Expand Up @@ -121,6 +121,14 @@ Naming/PredicateName:
Exclude:
- app/models/concerns/hydra/access_controls/access_right.rb

Rails/Exit:
Exclude:
- 'config/deploy.rb'

Rails/Output:
Exclude:
- 'config/deploy.rb'

RSpec/AnyInstance:
Exclude:
- spec/**/*
Expand Down Expand Up @@ -160,4 +168,4 @@ RSpec/NestedGroups:

Style/Alias:
Exclude:
- config/initializers/bulkrax.rb
- config/initializers/bulkrax.rb
16 changes: 16 additions & 0 deletions config/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,22 @@
end
end
end

namespace :deploy do
desc 'Ask user for CAB approval before deployment if stage is PROD'
task :confirm_cab_approval do
if fetch(:stage) == :PROD
ask(:cab_acknowledged, 'Have you submitted and received CAB approval? (Yes/No): ')
unless /^y(es)?$/i.match?(fetch(:cab_acknowledged))
puts 'Please submit a CAB request and get it approved before proceeding with deployment.'
exit
end
end
end
end

before 'deploy:starting', 'deploy:confirm_cab_approval'

# Default branch is :master
# ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp

Expand Down

0 comments on commit d193392

Please sign in to comment.