<commit_before># Capistrano::Hook

[![Gem Version](https://badge.fury.io/rb/capistrano-hook.svg)](http://badge.fury.io/rb/capistrano-hook)
[![Build Status](https://travis-ci.org/yulii/capistrano-hook.svg?branch=master)](https://travis-ci.org/yulii/capistrano-hook)
[![Code Climate](https://codeclimate.com/github/yulii/capistrano-hook/badges/gpa.svg)](https://codeclimate.com/github/yulii/capistrano-hook)
[![Dependency Status](https://gemnasium.com/yulii/capistrano-hook.svg)](https://gemnasium.com/yulii/capistrano-hook)

Notification hooks include start, finish and fail of deployments.

## Features

### Webhoook

Notify Capistrano deployments via webhook API.
Just set the webhook URL and message.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'capistrano-hook'
```

## Usage

Add this line to your Capfile:

```ruby
require 'capistrano/hook'
```

### Webhook

Webhook will not be run with no settings. You can setting the variables shown below.

```ruby
set :webhook_url, 'https://yulii.github.io/services'
set :webhook_starting_payload,   { text: 'Now, deploying...' }
set :webhook_finished_payload,   { text: 'Deployment has been completed!' }
set :webhook_failed_payload,     { text: 'Oops! something went wrong.' }
set :webhook_reverting_payload,  { text: 'Reverting...' }
set :webhook_rollbacked_payload, { text: 'Rollback has been completed!' }
```

Test your setup by running:
```
cap production webhook:post:starting
cap production webhook:post:finished
cap production webhook:post:failed
cap production webhook:post:reverting
cap production webhook:post:rollbacked
```


### Slack

Send notifications to Slack via incoming webhooks.

```ruby<commit_msg>update testing command list<commit_after># Capistrano::Hook

[![Gem Version](https://badge.fury.io/rb/capistrano-hook.svg)](http://badge.fury.io/rb/capistrano-hook)
[![Build Status](https://travis-ci.org/yulii/capistrano-hook.svg?branch=master)](https://travis-ci.org/yulii/capistrano-hook)
[![Code Climate](https://codeclimate.com/github/yulii/capistrano-hook/badges/gpa.svg)](https://codeclimate.com/github/yulii/capistrano-hook)
[![Dependency Status](https://gemnasium.com/yulii/capistrano-hook.svg)](https://gemnasium.com/yulii/capistrano-hook)

Notification hooks include start, finish and fail of deployments.

## Features

### Webhoook

Notify Capistrano deployments via webhook API.
Just set the webhook URL and message.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'capistrano-hook'
```

## Usage

Add this line to your Capfile:

```ruby
require 'capistrano/hook'
```

### Webhook

Webhook will not be run with no settings. You can setting the variables shown below.

```ruby
set :webhook_url, 'https://yulii.github.io/services'
set :webhook_starting_payload,   { text: 'Now, deploying...' }
set :webhook_finished_payload,   { text: 'Deployment has been completed!' }
set :webhook_failed_payload,     { text: 'Oops! something went wrong.' }
set :webhook_reverting_payload,  { text: 'Reverting...' }
set :webhook_rollbacked_payload, { text: 'Rollback has been completed!' }
```

### Testing

Test your setup by running:

```
# List the webhook configured variables
$ cap webhook:config:list

# Post a starting message
$ cap webhook:post:starting

# Post a finished message
$ cap webhook:post:finished

# Post a failed message
$ cap webhook:post:failed

# Post a reverting message
$ cap webhook:post:reverting

# Post a rollbacked message
$ cap webhook:post:rollbacked
```

### Slack

Send notifications to Slack via incoming webhooks.

```ruby
{'fraction_non_alphanumeric': 0.13715083798882682, 'fraction_numerical': 0.0, 'mean_word_length': 5.282456140350877, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 16, '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': '1235749', 'n_tokens_mistral': 1234, 'n_tokens_neox': 1184, 'n_words': 293}