<commit_before>lock '3.5.0'

set :application, 'deltamike_node'
set :repo_url,    '<EMAIL>:caspg/deltamike-node.git'
set :user,        'caspg'

set :deploy_to, "/home/#{fetch(:user)}/apps/#{fetch(:application)}"

set :linked_dirs, %w(
  node_modules
  log
)

set :keep_releases, 3

namespace :deploy do
  desc 'Make sure local git is in sync with remote.'
  task :check_revision do
    on roles(:app) do
      unless `git rev-parse HEAD` == `git rev-parse origin/master`
        puts 'WARNING: HEAD is not the same as origin/master'
        puts 'Run `git push` to sync changes.'
        exit
      end
    end
  end

  desc 'Initial Deploy'
  task :initial do
    on roles(:app) do
      before 'deploy:restart', 'deploy:start'
      invoke 'deploy'
    end
  end

  desc 'Restart application'
  task :restart do
    on roles(:app) do
      execute "cd '#{release_path}'; npm run restart-server-prod"
    end
  end

  desc 'Start application'
  task :start do
    on roles(:app) do
      execute "cd '#{release_path}'; npm run start-server-prod > /dev/null 2>&1 &"
    end
  end

  desc 'Build react file'
  task :build do
    on roles(:app) do
      execute "cd '#{release_path}'; npm run build"
    end
  end

  before :starting, :check_revision
  after :finishing, :build
  after :finishing, :restart
end<commit_msg>update deploy.rb<commit_after>lock '3.5.0'

set :application, 'deltamike_node'
set :repo_url,    '<EMAIL>:caspg/deltamike-node.git'
set :user,        'caspg'

set :deploy_to, "/home/#{fetch(:user)}/apps/#{fetch(:application)}"

set :linked_dirs, %w(
  node_modules
  log
)

set :keep_releases, 3

namespace :deploy do
  desc 'Make sure local git is in sync with remote.'
  task :check_revision do
    on roles(:app) do
      unless `git rev-parse HEAD` == `git rev-parse origin/master`
        puts 'WARNING: HEAD is not the same as origin/master'
        puts 'Run `git push` to sync changes.'
        exit
      end
    end
  end

  desc 'Initial Deploy'
  task :initial do
    on roles(:app) do
      before 'deploy:restart', 'deploy:start'
      invoke 'deploy'
    end
  end

  desc 'Stop application'
  task :stop do
    on roles(:app) do
      execute "cd '#{release_path}'; forever stop deltamike_node;"
    end
  end

  desc 'Start application'
  task :start do
    on roles(:app) do
      execute "cd '#{release_path}'; npm run start-server-prod > /dev/null 2>&1 &"
    end
  end

  desc 'Build react file'
  task :build do
    on roles(:app) do
      execute "cd '#{release_path}'; npm run build"
    end
  end

  before :starting, :check_revision
  after :finishing, :build
  after :finishing, :restart
  after :finishing, :start
end
{'fraction_non_alphanumeric': 0.11669793621013133, 'fraction_numerical': 0.00450281425891182, 'mean_word_length': 2.909090909090909, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '1726465', 'n_tokens_mistral': 945, 'n_tokens_neox': 915, 'n_words': 299}