<commit_before># encoding: utf-8

# Bundler
require 'bundler/capistrano'

# Maintenance
require 'capistrano/maintenance'
set :maintenance_template_path, File.expand_path("../templates/maintenance.rhtml", __FILE__)

# Assets
set :public_children, %w(images)
load 'deploy/assets'

# Common options
set :use_sudo,   false
set :scm,        :git
set :repository, "git://github.com/nono/linuxfr.org.git"
set :deploy_via, :remote_cache

default_run_options[:pty] = true


# We have two environments: alpha and prod.
# To make a deploy, precise on which environment, like this:
#   $ cap prod deploy
desc "Alpha environment"
task :alpha do
  set :vserver,   "alpha"
  set :user,      "alpha"
  set :branch,    $1 if `git branch` =~ /\* (\S+)\s/m
  set :rails_env, :alpha
end

desc "Production"
task :prod do
  set :vserver,   "prod"
  set :user,      "linuxfr"
  set :branch,    "master"
  set :rails_env, :production
end

desc "[internal] Common stuff to alpha and production"
task :common do
  set :application, "#{vserver}.linuxfr.org"
  set :deploy_to,   "/data/#{vserver}/#{user}/#{rails_env}"
  server "#{user}@#{application}", :app, :web, :db, :primary => true
  depend :remote, :file, "#{shared_path}/config/database.yml"
  depend :remote, :file, "#{shared_path}/config/secret.yml"
end
after "alpha", "common"
after "prod",  "common"


# Check that we have invoked an environment before deploying
before :deploy do
  unless exists?(:deploy_to)
    raise "Please invoke me like `cap env:<server> deploy` where <server> is prod or alpha"
  end
end


# Symlinks to share files/dirs between deploys
namespace :fs do
  desc "[internal] Install some symlinks to share files between deploys."
  task :symlink, :roles => :app, :except => { :no_release => true } do<commit_msg>Fix deployment with capistrano<commit_after># encoding: utf-8

# Bundler
require 'bundler/capistrano'

# Maintenance
require 'capistrano/maintenance'
set :maintenance_template_path, File.expand_path("../templates/maintenance.rhtml", __FILE__)

# Assets
set :public_children, %w(images)
load 'deploy/assets'

# Common options
set :use_sudo,   false
set :scm,        :git
set :repository, "git://github.com/nono/linuxfr.org.git"
set :deploy_via, :remote_cache

default_run_options[:pty] = true


# We have two environments: alpha and prod.
# To make a deploy, precise on which environment, like this:
#   $ cap prod deploy
desc "Alpha environment"
task :alpha do
  set :vserver,   "alpha"
  set :user,      "alpha"
  set :branch,    $1 if `git branch` =~ /\* (\S+)\s/m
  set :rails_env, "alpha"
end

desc "Production"
task :prod do
  set :vserver,   "prod"
  set :user,      "linuxfr"
  set :branch,    "master"
  set :rails_env, "production"
end

desc "[internal] Common stuff to alpha and production"
task :common do
  set :application, "#{vserver}.linuxfr.org"
  set :deploy_to,   "/data/#{vserver}/#{user}/#{rails_env}"
  server "#{user}@#{application}", :app, :web, :db, :primary => true
  depend :remote, :file, "#{shared_path}/config/database.yml"
  depend :remote, :file, "#{shared_path}/config/secret.yml"
end
after "alpha", "common"
after "prod",  "common"


# Check that we have invoked an environment before deploying
before :deploy do
  unless exists?(:deploy_to)
    raise "Please invoke me like `cap env:<server> deploy` where <server> is prod or alpha"
  end
end


# Symlinks to share files/dirs between deploys
namespace :fs do
  desc "[internal] Install some symlinks to share files between deploys."
  task :symlink, :roles => :app, :except => { :no_release => true } do
{'fraction_non_alphanumeric': 0.13558368495077355, 'fraction_numerical': 0.0011251758087201125, 'mean_word_length': 4.323353293413174, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, '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': '2921247', 'n_tokens_mistral': 1216, 'n_tokens_neox': 1185, 'n_words': 386}