capistrano-slacky 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -1
- data/README.md +111 -2
- data/lib/capistrano/slacky/command/diff.rb +4 -1
- data/lib/capistrano/slacky/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4376f99f85cd346b93ac12f632e2e48b412fb63fa4e08df39b90caa1d2ad677
|
4
|
+
data.tar.gz: c3dba2f05bee71965340ecd4c916930220ace00bc68f223ed182367afc7a3d15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc260001544951a188d32e91542f63c59508d3abefd8e8656b8b8b14b95ae37efa7e2bd40e3c1a4b0f533d3722b68287fa9ae9112a14311babdac00d1ca50a2c
|
7
|
+
data.tar.gz: e1885a2c60f1fc88f98a1dcefd06bdd689477484963a2cf50229b41d574d170830dbf326eaa5ea3ab49ff435897b68e8af883a4d58ecf5f11574550de1053eea
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## [Unreleased]
|
8
|
+
|
9
|
+
## [0.1.3] - 2021-06-14
|
10
|
+
### Changed
|
11
|
+
- Update `README.md`. ([@chubchenko][])
|
12
|
+
|
13
|
+
### Fixed
|
14
|
+
- Change commit message encoding to `UTF-8`. ([@chubchenko][])
|
15
|
+
|
7
16
|
## [0.1.2] - 2021-06-03
|
8
17
|
### Changed
|
9
18
|
- Use `I18n.t` instead of `t`. ([@chubchenko][])
|
@@ -31,7 +40,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
31
40
|
- Initial version. ([@chubchenko][])
|
32
41
|
|
33
42
|
[@chubchenko]: https://github.com/chubchenko
|
34
|
-
[Unreleased]: https://github.com/chubchenko/capistrano-slacky/compare/v0.1.
|
43
|
+
[Unreleased]: https://github.com/chubchenko/capistrano-slacky/compare/v0.1.3...HEAD
|
44
|
+
[0.1.3]: https://github.com/chubchenko/capistrano-slacky/compare/v0.1.2...v0.1.3
|
35
45
|
[0.1.2]: https://github.com/chubchenko/capistrano-slacky/compare/v0.1.1...v0.1.2
|
36
46
|
[0.1.1]: https://github.com/chubchenko/capistrano-slacky/compare/v0.1.0...v0.1.1
|
37
47
|
[0.1.0]: https://github.com/chubchenko/capistrano-slacky/releases/tag/v0.1.0
|
data/README.md
CHANGED
@@ -1,14 +1,123 @@
|
|
1
|
+
<div align="center">
|
2
|
+
<img align="center"
|
3
|
+
height="100"
|
4
|
+
title="capistrano-slacky logo"
|
5
|
+
src="./assets/images/logo.svg">
|
6
|
+
</div>
|
7
|
+
|
8
|
+
[![gem version][9]][10]
|
1
9
|
[![build][1]][2]
|
10
|
+
[![downloads][11]][12]
|
2
11
|
|
3
12
|
# capistrano-slacky
|
4
13
|
|
5
|
-
Send `Capistrano` deployment status to `Slack
|
14
|
+
Send `Capistrano` deployment status to `Slack` via the Incoming Webhooks integration.
|
15
|
+
|
16
|
+
- Messages are built on the basis of the [Block Kit][13]. See [Demo](#demo) section.
|
17
|
+
- Fires after every successful/failed deployment or rollback.
|
18
|
+
- Use _Incoming Webhook URL_ from the remote server.
|
19
|
+
- Send commit log between 2 deployments.
|
20
|
+
|
21
|
+
## Table of Contents
|
22
|
+
|
23
|
+
- [Requirements](#requirements)
|
24
|
+
- [Installation](#installation)
|
25
|
+
- [Configuration](#configuration)
|
26
|
+
- [Usage](#usage)
|
27
|
+
- [Demo](#demo)
|
28
|
+
|
29
|
+
## Requirements
|
30
|
+
|
31
|
+
- Ruby >= 2.5
|
32
|
+
- Capistrano ~> 3.0
|
33
|
+
- Slack
|
34
|
+
|
35
|
+
## Installation
|
36
|
+
|
37
|
+
Add the following line to your `Gemfile`:
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
gem "capistrano-slacky", "~> 0.1", require: false
|
41
|
+
```
|
42
|
+
|
43
|
+
And then execute:
|
44
|
+
|
45
|
+
```bash
|
46
|
+
bundle install
|
47
|
+
```
|
48
|
+
|
49
|
+
## Configuration
|
50
|
+
|
51
|
+
Out of the box, the gem has a default configuration:
|
52
|
+
|
53
|
+
```ruby
|
54
|
+
set :slacky, username: "ChatOps", # Set your bot's user name.
|
55
|
+
icon_emoji: ":robot_face:", # Emoji to use as the icon for this message.
|
56
|
+
channel: "#deployment", # The name of the channel to send a message to.
|
57
|
+
klass: Capistrano::Slacky::Messaging::Default # The class that responsible for creating a message.
|
58
|
+
```
|
59
|
+
|
60
|
+
So you can easily tweak your deployment messages and all other configuration to what you want.
|
61
|
+
|
62
|
+
## Usage
|
63
|
+
|
64
|
+
Require the library in your application's Capfile
|
65
|
+
|
66
|
+
```ruby
|
67
|
+
require "capistrano/slacky"
|
68
|
+
```
|
69
|
+
|
70
|
+
- Add an [Incoming Webhooks][4] to your Slack.
|
71
|
+
- The received _Incoming Webhook URL_ must be uploaded to the remote server. It should be stored in a `shared` directory under the following path `config/slacky.yml`.
|
72
|
+
- Run `cap production slacky:ping` command to test your integration.
|
73
|
+
|
74
|
+
That's all, deploy your application as usual and you will see a deployment notification in your Slack channel.
|
75
|
+
|
76
|
+
In case if you want to disable deployment notifications for a specific stage just set `slacky` to `false`.
|
77
|
+
|
78
|
+
```ruby
|
79
|
+
set :slacky, false
|
80
|
+
```
|
81
|
+
|
82
|
+
## Demo
|
83
|
+
|
84
|
+
![Deployed successfully][5]
|
85
|
+
|
86
|
+
![Reverted successfully][6]
|
87
|
+
|
88
|
+
## Supported Ruby Versions
|
89
|
+
|
90
|
+
This library aims to support and is [tested against][2] the following Ruby implementations:
|
91
|
+
|
92
|
+
- Ruby 2.5
|
93
|
+
- Ruby 2.6
|
94
|
+
- Ruby 2.7
|
95
|
+
- Ruby 3.0
|
96
|
+
|
97
|
+
If something doesn't work on one of these Ruby versions, it's a bug.
|
98
|
+
|
99
|
+
## Versioning
|
100
|
+
|
101
|
+
This library aims to adhere to [Semantic Versioning 2.0.0][4]. Violations of this scheme should be reported as bugs. Specifically, if a minor or patch version is released that breaks backward compatibility, that version should be immediately yanked, and/or a new version should be immediately released that restores compatibility. Breaking changes to the public API will only be introduced with new major versions. As a result of this policy, you can (and should) specify a dependency on this gem using the [Pessimistic Version Constraint][5] with two digits of precision. For example:
|
102
|
+
|
103
|
+
```ruby
|
104
|
+
gem "capistrano-slacky", "~> 0.1"
|
105
|
+
```
|
6
106
|
|
7
107
|
## License
|
8
108
|
|
9
109
|
[MIT][3]
|
10
110
|
|
11
|
-
|
12
111
|
[1]: https://github.com/chubchenko/capistrano-slacky/actions/workflows/build.yml/badge.svg
|
13
112
|
[2]: https://github.com/chubchenko/capistrano-slacky/actions/workflows/build.yml
|
14
113
|
[3]: https://choosealicense.com/licenses/mit
|
114
|
+
[4]: https://api.slack.com/messaging/webhooks
|
115
|
+
[5]: ./assets/images/deployed_successfully.jpg
|
116
|
+
[6]: ./assets/images/deployment_failed.jpg
|
117
|
+
[7]: ./assets/images/reverted_successfully.jpg
|
118
|
+
[8]: ./assets/images/rollback_failed.jpg
|
119
|
+
[9]: https://badge.fury.io/rb/capistrano-slacky.svg
|
120
|
+
[10]: https://badge.fury.io/rb/capistrano-slacky
|
121
|
+
[11]: https://img.shields.io/gem/dt/capistrano-slacky
|
122
|
+
[12]: https://rubygems.org/gems/capistrano-slacky
|
123
|
+
[13]: https://api.slack.com/block-kit
|
@@ -54,6 +54,9 @@ module Capistrano
|
|
54
54
|
"0" => ":zero:"
|
55
55
|
}.freeze
|
56
56
|
|
57
|
+
DEFAULT_ENCODING = "UTF-8"
|
58
|
+
private_constant :DEFAULT_ENCODING
|
59
|
+
|
57
60
|
def initialize(index:, sha:, commit:)
|
58
61
|
@index = index
|
59
62
|
@sha = sha
|
@@ -71,7 +74,7 @@ module Capistrano
|
|
71
74
|
end
|
72
75
|
|
73
76
|
def commit
|
74
|
-
@commit.delete('"').strip
|
77
|
+
@commit.delete('"').strip.force_encoding(DEFAULT_ENCODING)
|
75
78
|
end
|
76
79
|
|
77
80
|
def to_a
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-slacky
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Artem Chubchenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-06-
|
11
|
+
date: 2021-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
@@ -72,7 +72,7 @@ dependencies:
|
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '0.21'
|
75
|
-
description: Send Capistrano deployment status to Slack via the
|
75
|
+
description: Send Capistrano deployment status to Slack via the Incoming Webhooks
|
76
76
|
integration
|
77
77
|
email: artem.chubchenko@gmail.com
|
78
78
|
executables: []
|