class Promotion::Application
The Promotion::Application
coordinates the activity of the components:
Public Class Methods
new(appname)
click to toggle source
Creates a new Promotion::Application
instance for a specific app to be promoted. A global +$log+ logger is also created.
# File lib/promotion/application.rb, line 19 def initialize(appname) @appname = appname $log = Logger.new(Files::Log, 0) # rotate log file at 1M limit $log.formatter = proc { |severity, datetime, progname, message| "#{datetime.iso8601()} #{severity} #{message}\n" } $log.level = Logger::INFO end
Public Instance Methods
devolve(target=nil)
click to toggle source
Devolve a database back to an earlier version
# File lib/promotion/application.rb, line 44 def devolve(target=nil) evolver = Promotion::Evolver.new(@appname, false, target) evolver.start() end
evolve(target=nil)
click to toggle source
Evolves the database to a target version, or as far as possible, by executing database migration scripts in the evolve
folder
# File lib/promotion/application.rb, line 38 def evolve(target=nil) evolver = Promotion::Evolver.new(@appname, true, target) evolver.start() end
promote()
click to toggle source
Promotes an application into production.
# File lib/promotion/application.rb, line 29 def promote() enforcer = Promotion::Enforcer.new(@appname) enforcer.start() Generator::start() $log.info("Application #{@appname} successfully promoted.") end