<commit_before>Capify Ec2
====================================================

capify-ec2 is used to generate capistrano namespaces using ec2 tags. 

eg: If you have three servers on amazon's ec2.

    server-1 Tag: Role => "web"
    server-2 Tag: Role => "db"
    server-3 Tag: Role => "web"

Installing

    gem install capify-ec2

In your deploy.rb:

    require "capify-ec2/capistrano"
    ec2_roles :web

Will generate

    task :server-1 do
      role :web, {server-1 public dns fetched from Amazon}
    end
    
    task :server-3 do
      role :web, {server-1 public dns fetched from Amazon}
    end
    
    task :web do
      role :web, {server-1 public dns fetched from Amazon}
      role :web, {server-3 public dns fetched from Amazon}
    end

Additionally

    require "capify-ec2/capistrano"
    ec2_roles :db

Will generate

    task :server-2 do
      role :web, {server-2 public dns fetched from Amazon}
    end
    
    task :db do
      role :db, {server-2 public dns fetched from Amazon}
    end

Running

    cap web date

will run the date command on all server's tagged with the web role

More options
====================================================

    ec2_roles {:name=>"web", :options=>{:cron=>"server-1"}}
  
Will generate

    task :server-1 do
      role :web, {server-1 public dns fetched from Amazon}, :cron=>true
    end

    task :server-3 do
      role :web, {server-1 public dns fetched from Amazon}
    end

    task :web do
      role :web, {server-1 public dns fetched from Amazon}, :cron=>true
      role :web, {server-3 public dns fetched from Amazon}
    end

Which is cool if you want a task like this in deploy.rb

    task :update_cron => :web, :only=>{:cron} do
      Do something to a server with cron on it
    end

Ec2 config
====================================================

This gem requires 'config/ec2.yml' in your project.
The yml file needs to look something like this:

    	:aws_access_key_id: "YOUR ACCESS KEY"
    	:aws_secret_access_key: "YOUR SECRET"
    	:aws_params:
    	  :region: 'eu-west-1'
		:load_balanced: true

The :aws_params are optional.
If :load_balanced is set to true, the gem will deregister 
the instance from the load balancer before deploying and
reregister it after, using before and after deploy hooks.
:load_balanced only works for individual instances, not
for roles.<commit_msg>Added documentation about register and deregister instance<commit_after>Capify Ec2
====================================================

capify-ec2 is used to generate capistrano namespaces using ec2 tags. 

eg: If you have three servers on amazon's ec2.

    server-1 Tag: Role => "web"
    server-2 Tag: Role => "db"
    server-3 Tag: Role => "web"

Installing

    gem install capify-ec2

In your deploy.rb:

    require "capify-ec2/capistrano"
    ec2_roles :web

Will generate

    task :server-1 do
      role :web, {server-1 public dns fetched from Amazon}
    end
    
    task :server-3 do
      role :web, {server-1 public dns fetched from Amazon}
    end
    
    task :web do
      role :web, {server-1 public dns fetched from Amazon}
      role :web, {server-3 public dns fetched from Amazon}
    end

Additionally

    require "capify-ec2/capistrano"
    ec2_roles :db

Will generate

    task :server-2 do
      role :web, {server-2 public dns fetched from Amazon}
    end
    
    task :db do
      role :db, {server-2 public dns fetched from Amazon}
    end

Running

    cap web date

will run the date command on all server's tagged with the web role

Running

  cap server-1 register-instance -s loadbalancer=elb-1

will register server-1 to be used by elb-1

Running
  
  cap server-1 deregister instance

will remove server-1 from whatever instance it is currently
registered against.

More options
====================================================

    ec2_roles {:name=>"web", :options=>{:cron=>"server-1"}}
  
Will generate

    task :server-1 do
      role :web, {server-1 public dns fetched from Amazon}, :cron=>true
    end

    task :server-3 do
      role :web, {server-1 public dns fetched from Amazon}
    end

    task :web do
      role :web, {server-1 public dns fetched from Amazon}, :cron=>true
      role :web, {server-3 public dns fetched from Amazon}
    end

Which is cool if you want a task like this in deploy.rb

    task :update_cron => :web, :only=>{:cron} do
      Do something to a server with cron on it
    end

Ec2 config
====================================================

This gem requires 'config/ec2.yml' in your project.
The yml file needs to look something like this:

    	:aws_access_key_id: "YOUR ACCESS KEY"
    	:aws_secret_access_key: "YOUR SECRET"
    	:aws_params:
    	  :region: 'eu-west-1'
		  :load_balanced: true

The :aws_params are optional.
If :load_balanced is set to true, the gem uses pre and post-deploy
hooks to deregister the instance, reregister it, and validate its
health.
:load_balanced only works for individual instances, not
for roles.
====================================================
{'fraction_non_alphanumeric': 0.14364859517214087, 'fraction_numerical': 0.013850415512465374, 'mean_word_length': 3.1502463054187193, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, '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': '2031675', 'n_tokens_mistral': 1615, 'n_tokens_neox': 1534, 'n_words': 608}