<commit_before>namespace :deploy do
  desc "Start the server"
  task :start, :roles => :app, :except => { :no_release => true } do
    run "#{try_sudo :as => 'root'} start #{application}"
  end

  task :stop, :roles => :app, :except => { :no_release => true } do
    run "#{try_sudo :as => 'root'} stop #{application}"
  end

  task :restart, :roles => :app, :except => { :no_release => true } do
    run "#{try_sudo :as => 'root'} restart #{application} || #{try_sudo :as => 'root'} start #{application}"
  end

  desc "Create a symlinks in /etc/monit to the monit files in the deployed app"
  task "symlink_monit_config" do
    run "#{try_sudo :as => 'root'} ln -f -s #{current_path}/config/monit/* /etc/monit/"
  end

  desc "save the local version of the upstart script to the server"
  task :send_upstart_script, :roles => :app do
    remote_tempfile = "/tmp/#{application}_upstart.conf"
    upstart_file = <<UPSTART
description "#{application}"

start on startup
stop on shutdown

script
    # Node needs HOME to be set
    export HOME="#{current_path}"
    
    exec sudo -u nodejs /usr/local/bin/node #{current_path}/server.js production 2>>/var/log/wompt.error.log >>/var/log/wompt.log
end script
UPSTART
    put upstart_file, remote_tempfile
    run "#{try_sudo :as => 'root'} mv #{remote_tempfile} /etc/init/#{application}.conf"
  end
  
  desc "Update git submodules for the cached copy (Cpaistrano 2.5.20 will do this automatically)"
  task "update_submodules_recursive" do
    run "cd #{shared_path}/cached-copy && git submodule update --init --recursive"
  end
  
  ## Disable some default tasks that don't apply to a NodeJS app
  task :migrate do
    puts "    not doing migrate because not a Rails application."
  end
  task :finalize_update do
    puts "    not doing finalize_update because not a Rails application."
  end
end
<commit_msg>Modified the app start directory in the upstart script and monit config<commit_after>namespace :deploy do
  desc "Start the server"
  task :start, :roles => :app, :except => { :no_release => true } do
    run "#{try_sudo :as => 'root'} start #{application}"
  end

  task :stop, :roles => :app, :except => { :no_release => true } do
    run "#{try_sudo :as => 'root'} stop #{application}"
  end

  task :restart, :roles => :app, :except => { :no_release => true } do
    run "#{try_sudo :as => 'root'} restart #{application} || #{try_sudo :as => 'root'} start #{application}"
  end

  desc "Create a symlinks in /etc/monit to the monit files in the deployed app"
  task "symlink_monit_config" do
    run "#{try_sudo :as => 'root'} ln -f -s #{current_path}/nodejs/config/monit/* /etc/monit/"
  end

  desc "save the local version of the upstart script to the server"
  task :send_upstart_script, :roles => :app do
    remote_tempfile = "/tmp/#{application}_upstart.conf"
    upstart_file = <<UPSTART
description "#{application}"

start on startup
stop on shutdown

script
    # Node needs HOME to be set
    export HOME="#{current_path}/nodejs"
    
    exec sudo -u nodejs /usr/local/bin/node #{current_path}/nodejs/server.js production 2>>/var/log/wompt.error.log >>/var/log/wompt.log
end script
UPSTART
    put upstart_file, remote_tempfile
    run "#{try_sudo :as => 'root'} mv #{remote_tempfile} /etc/init/#{application}.conf"
  end
  
  desc "Update git submodules for the cached copy (Cpaistrano 2.5.20 will do this automatically)"
  task "update_submodules_recursive" do
    run "cd #{shared_path}/cached-copy && git submodule update --init --recursive"
  end
  
  ## Disable some default tasks that don't apply to a NodeJS app
  task :migrate do
    puts "    not doing migrate because not a Rails application."
  end
  task :finalize_update do
    puts "    not doing finalize_update because not a Rails application."
  end
end

{'fraction_non_alphanumeric': 0.12674571805006588, 'fraction_numerical': 0.002635046113306983, 'mean_word_length': 3.6236297198538368, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '1965354', 'n_tokens_mistral': 1269, 'n_tokens_neox': 1226, 'n_words': 429}