module Promotion::Generator

Public Class Methods

gather_specs() click to toggle source

Gathers specs from all deployment descriptors in folders with the staging area

# File lib/promotion/generator.rb, line 22
    def self.gather_specs()
specs = []
            begin
                    search = Folders::Staging + "/*/" + Files::Spec
                    $log.debug("Searching for application specs with Dir[#{search}]")
                    specfiles = Dir[search]
                    specfiles.each { |filename|
                            specfile = File.new(filename, File::RDONLY)
                            doc = ::REXML::Document.new(specfile)
                            specs << doc.root
                            specfile.close()
                    }
                    return(specs)
            rescue => e
                    $log.error("Error while gathering application specs\n#{e.message}" + e.backtrace.join("\n"))
                    exit 1
            end
    end
start() click to toggle source
# File lib/promotion/generator.rb, line 11
def self.start()
              $log.info("\n#{'_'*40}\nChecking common environment files")
              specs = self.gather_specs()
              Profile.check(specs)
              Rcconf.check(specs)
              Newsyslog.check(specs)
              Sudoers.check(specs)
              Crontab.check(specs)
end