<commit_before><%
require' yaml'

# load each yaml in /apps
apps = {}
for yaml in Dir['/etc/god/apps/*.yml']
  raw_config = File.read(yaml)
  app_config = YAML.load(raw_config)
  apps.merge!(app_config)
end

#apps = {
#  'moose' => {:deploy_dir => 'moose.campusforchrist.org', :workers => 1, :env => 'production'},
#  'emu' => {:deploy_dir => 'emu.campusforchrist.org', :workers => 1, :env => 'production'}, 
#  'pulse' => {:deploy_dir => 'pulse.campusforchrist.org', :workers => 1, :env => 'production'} }
#
apps.each do |app, params|
  #rails_root = "/var/www/#{params[:deploy_dir]}/current"
  rails_root = "#{params[:deploy_to]}/current"
  params[:workers].times do |num|
    God.watch do |w|
      w.name = "dj-#{app}-#{num}"
      w.group = "dj-#{app}"
      w.interval = 30.seconds
      w.dir = rails_root
      w.env = { "RAILS_ENV" => params[:env] }
      w.log = "#{rails_root}/log/god.log"
      w.start = "rake jobs:work"
 
      w.uid = 'deploy'
      w.gid = 'www-data'
 <commit_msg>fix require<commit_after><%
require 'yaml'

# load each yaml in /apps
apps = {}
for yaml in Dir['/etc/god/apps/*.yml']
  raw_config = File.read(yaml)
  app_config = YAML.load(raw_config)
  apps.merge!(app_config)
end

#apps = {
#  'moose' => {:deploy_dir => 'moose.campusforchrist.org', :workers => 1, :env => 'production'},
#  'emu' => {:deploy_dir => 'emu.campusforchrist.org', :workers => 1, :env => 'production'}, 
#  'pulse' => {:deploy_dir => 'pulse.campusforchrist.org', :workers => 1, :env => 'production'} }
#
apps.each do |app, params|
  #rails_root = "/var/www/#{params[:deploy_dir]}/current"
  rails_root = "#{params[:deploy_to]}/current"
  params[:workers].times do |num|
    God.watch do |w|
      w.name = "dj-#{app}-#{num}"
      w.group = "dj-#{app}"
      w.interval = 30.seconds
      w.dir = rails_root
      w.env = { "RAILS_ENV" => params[:env] }
      w.log = "#{rails_root}/log/god.log"
      w.start = "rake jobs:work"
 
      w.uid = 'deploy'
      w.gid = 'www-data'
 
{'fraction_non_alphanumeric': 0.21084337349397592, 'fraction_numerical': 0.0050200803212851405, 'mean_word_length': 3.276824034334764, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6038494', 'n_tokens_mistral': 824, 'n_tokens_neox': 763, 'n_words': 151}