Sha256: 1533b5ee09b730c98e04dcaf247263dc6fb2c41f03b341412ad590b8e206192e
Contents?: true
Size: 1.95 KB
Versions: 30
Compression:
Stored size: 1.95 KB
Contents
desc 'security-update [STEP]', 'Support for performing security updates' long_desc <<-LONGDESC Preparation for security update: `geordi security-update` After performing the update: `geordi security-update finish` Switches branches, pulls, pushes and deploys as required by our workflow. Tells what it will do before it does it. LONGDESC def security_update(step='prepare') case step when 'prepare' announce 'Preparing for security update' warn 'Please read https://makandracards.com/makandra/1587 before applying security updates!' note 'About to checkout production and pull' prompt('Continue?', 'y', /y|yes/) or fail 'Cancelled.' Util.system! 'git checkout production', :show_cmd => true Util.system! 'git pull', :show_cmd => true success 'Successfully prepared for security update' puts note 'Please apply the security update now.' note 'When you are done, run `geordi security-update finish`.' when 'finish' announce 'Finishing security update' # ensure everything is committed `git status --porcelain`.empty? or fail('There are uncommitted changes.') note 'Working directory clean.' prompt('Have you successfully run all tests?', 'n', /y|yes/) or fail 'Please run tests first.' note 'About to: push production, checkout & pull master, merge production, push master, deploy all stages' prompt('Continue?', 'n', /y|yes/) or fail 'Cancelled.' Util.system! 'git push', :show_cmd => true Util.system! 'git checkout master', :show_cmd => true Util.system! 'git pull', :show_cmd => true Util.system! 'git merge production', :show_cmd => true Util.system! 'git push', :show_cmd => true invoke_cmd 'capistrano', 'deploy:migrations' success 'Successfully pushed and deployed security update' puts note 'Now send an email to customer and project lead, informing them about the update.' note 'Do not forget to make a joblog on a security budget, if available.' end end
Version data entries
30 entries across 30 versions & 1 rubygems