<commit_before># Setup
set :application, "bugsnag-notification-plugins"
set :repository, "<EMAIL>:bugsnag/bugsnag-notification-plugins.git"
set :scm, :git
set :deploy_to, "/var/www/bugsnag/notification-plugins"
set :deploy_via, :remote_cache
set :copy_exclude, ".git"
default_run_options[:pty] = true

# Roles
role :app, "bugsnag.com"

set :trigger_servers, [
  "bugsnag-trigger-worker"
]

# Node magic
namespace :deploy do
  task :start, :roles => :app, :except => { :no_release => true } do
    trigger_servers.each do |s|
      sudo "start #{s}"
    end
  end

  task :stop, :roles => :app, :except => { :no_release => true } do
    trigger_servers.each do |s|
      sudo "stop #{s}"
    end
  end

  task :restart, :roles => :app, :except => { :no_release => true } do
    trigger_servers.each do |s|
      sudo "restart #{s} || sudo start #{s}"
    end
  end

  desc "Check required packages and install if packages are not installed"
  task :check_packages, roles => :app do
    child_folders = Dir[File.join(release_path, "*")].select{|file| File.ftype(file) == "directory"}.each{|folder| run "cd #{folder} && npm-install"}
  end
end

after "deploy:finalize_update", "deploy:check_packages"
after "deploy:symlink", "deploy:restart"<commit_msg>Try getting deploy working<commit_after># Setup
set :application, "bugsnag-notification-plugins"
set :repository, "<EMAIL>:bugsnag/bugsnag-notification-plugins.git"
set :user, "deploy"
set :scm, :git
set :deploy_to, "/var/www/bugsnag/notification-plugins"
set :deploy_via, :remote_cache
set :copy_exclude, ".git"
default_run_options[:pty] = true

# Roles
role :app, "bugsnag.com"

set :trigger_servers, [
  "bugsnag-trigger-worker"
]

# Node magic
namespace :deploy do
  task :start, :roles => :app, :except => { :no_release => true } do
    trigger_servers.each do |s|
      sudo "start #{s}"
    end
  end

  task :stop, :roles => :app, :except => { :no_release => true } do
    trigger_servers.each do |s|
      sudo "stop #{s}"
    end
  end

  task :restart, :roles => :app, :except => { :no_release => true } do
    trigger_servers.each do |s|
      sudo "restart #{s} || sudo start #{s}"
    end
  end

  desc "Check required packages and install if packages are not installed"
  task :check_packages, roles => :app do
    child_folders = Dir[File.join(release_path, "*")].select{|file| File.ftype(file) == "directory"}.each{|folder| run "cd #{folder} && npm-install"}
  end
end

after "deploy:finalize_update", "deploy:check_packages"
after "deploy:symlink", "deploy:restart"
{'fraction_non_alphanumeric': 0.15238847216739046, 'fraction_numerical': 0.0, 'mean_word_length': 4.246376811594203, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1406570', 'n_tokens_mistral': 909, 'n_tokens_neox': 879, 'n_words': 241}