Support-pl/ione

Make an updates installer

Closed this issue · 1 comments

Add updates installer, so the one can make: rake install_update <%version-tag%> and get all patches.

Store update schemas in /updates
Maybe something like

/updates/tags:

v.1.0.0_testing -> v.1.0.1_stable -- 100_2_101.diff.rb

100_2_101.diff.rb:

require 'updates/helper.rb'

updated_files = [{
 type: :hook,
 src: 'hooks/set_price.rb'
}, ...]
post_update_actions = [ :build_ui ]

class UpdateHelper
 def perform_update
  # may update DB schema or ONe instances
  super.perform_update
 end
end

Or whatever bull.... will work unchanged at least next couple releases

Then updates/helper.rb will have default helpers like def file_overwrite conf, which would know where the :hook`s are and will do cp_f. Same something like def run_action action, which would know what to do if it has :build_ui action(go to ui, npm install, npm run build)