<commit_before># Deployments

Library for pushing details(commits, tag, username, env) about the current app

## Installation

Add this line to your application's Gemfile:

    gem 'deployments'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install deployments

## Usage

If you are using Rails 2 version you should add load method to your Rakefile:

```ruby
  load "#{Gem.searcher.find('deployments').full_gem_path}/lib/tasks/deployments.rake"
```

At first you need to create in the config folder deployments.yml file with
receiver server url and domains of different envs of your application:

```yaml
  options:
    server: "your deployments server that will save build version"
  development:
    domain: "development.example.com"
    api_key: "development api key"
  staging:
    domain: "staging.example.com"
    api_key: "staging api key"
```

Add to your capistrano recipes the next following line, changing your_app_env
to the deployment environment like 'staging' or 'development':

```ruby
  require 'deployments'

  before 'deploy' do
    sh <<-CMD
      rake deployments:push app_env=your_app_env
    CMD
  end
```

Request params:
```ruby
  {
    {
      :author => "author",
      :commit_attributes => {
        "commit id" => "Add readme file",
        "commit id" => "Change readme file"
      },
      :env => "staging",
      :version => "1.0.1",
      :domain => "staging.example.com"
    },
    :api_key => "account api key"
  }
```

Also you can use capistrano recipes of the gem, you need to add:
```ruby
  require 'deployments/recipes'
```

It will add capistrano hook "after 'deploy'" for pushing deployment details to
the server after deploy.
<commit_msg>Fix in readme example for capistrano task<commit_after># Deployments

Library for pushing details(commits, tag, username, env) about the current app

## Installation

Add this line to your application's Gemfile:

    gem 'deployments'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install deployments

## Usage

If you are using Rails 2 version you should add load method to your Rakefile:

```ruby
  load "#{Gem.searcher.find('deployments').full_gem_path}/lib/tasks/deployments.rake"
```

At first you need to create in the config folder deployments.yml file with
receiver server url and domains of different envs of your application:

```yaml
  options:
    server: "your deployments server that will save build version"
  development:
    domain: "development.example.com"
    api_key: "development api key"
  staging:
    domain: "staging.example.com"
    api_key: "staging api key"
```

Add to your capistrano recipes the next following line, changing your_app_env
to the deployment environment like 'staging' or 'development':

```ruby
  require 'deployments'

  after 'deploy' do
    run <<-CMD
      rake deployments:push app_env=your_app_env
    CMD
  end
```

Request params:
```ruby
  {
    {
      :author => "author",
      :commit_attributes => {
        "commit id" => "Add readme file",
        "commit id" => "Change readme file"
      },
      :env => "staging",
      :version => "1.0.1",
      :domain => "staging.example.com"
    },
    :api_key => "account api key"
  }
```

Also you can use capistrano recipes of the gem, you need to add:
```ruby
  require 'deployments/recipes'
```

It will add capistrano hook "after 'deploy'" for pushing deployment details to
the server after deploy.

{'fraction_non_alphanumeric': 0.10098665118978525, 'fraction_numerical': 0.0023215322112594312, 'mean_word_length': 3.447741935483871, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 19, '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': '584464', 'n_tokens_mistral': 1102, 'n_tokens_neox': 1031, 'n_words': 392}