capistrano-hook 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3bcc558b728d64f19584877152cf868fa05c34e0
4
- data.tar.gz: 9d6d9928e189d4d10d5d7c040c7b476e910e8ccd
3
+ metadata.gz: 1ae3585f41ea69167d0bc3ebd77ee93d38f5ce89
4
+ data.tar.gz: e0d3e0a4c702b40b1aef4712ed6a1c1ceca456e7
5
5
  SHA512:
6
- metadata.gz: a0b08c655b908e49deff5fa05ceb0f49bc9a36a3b4810c8d4fd9de8829705ce99fc0b839dcf66356421f367a5a55ab8b191888a9a722e3f689a0684e4896c91e
7
- data.tar.gz: dc2432d843a704f4138f2a3b4b8a3552121e189019af6b68fa645187306880d998d72667b892ef0720150faa656a4580993e8e9033dd75fc9f92e7338e554d4c
6
+ metadata.gz: 51f678aa09aa2068ea691515a6d67fd6513b3211c439d12c4dc62ed6f9bf20d3ed98b661005cb2f482540b969fad856850c953f7dd7fefca3576937b294e3aec
7
+ data.tar.gz: bd50536bc35fffe3dc6190d4b05c6088d67dfe59ec498b8ada73c1f947bf50d6479d61fc65223400ba0c3c39637cd690e0493b13ff917d511fea136a765ec53f
data/.rubocop.yml CHANGED
@@ -1 +1,9 @@
1
- inherit_from: .rubocop_todo.yml
1
+ Metrics/LineLength:
2
+ Max: 104
3
+
4
+ Style/Documentation:
5
+ Enabled: false
6
+
7
+ SingleSpaceBeforeFirstArg:
8
+ Enabled: false
9
+
data/README.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Capistrano::Hook
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/capistrano-hook.svg)](http://badge.fury.io/rb/capistrano-hook)
4
+ [![Build Status](https://travis-ci.org/yulii/capistrano-hook.svg)](https://travis-ci.org/yulii/capistrano-hook)
5
+ [![Dependency Status](https://gemnasium.com/yulii/capistrano-hook.svg)](https://gemnasium.com/yulii/capistrano-hook)
6
+
7
+ Notification hooks include start, finish and fail of deployments.
8
+
3
9
  ## Installation
4
10
 
5
11
  Add this line to your application's Gemfile:
data/bin/console CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require 'bundler/setup'
4
- require 'capistrano/hook'
4
+ require 'capistrano/hook/load'
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
data/bin/test ADDED
@@ -0,0 +1,9 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ CWD=$(pwd)
4
+ SWD=$(cd `dirname $0` && pwd)
5
+ IFS=$'\n\t'
6
+
7
+ bundle exec rake
8
+ bundle exec rubocop --auto-correct
9
+
@@ -7,10 +7,10 @@ Gem::Specification.new do |spec|
7
7
  spec.name = 'capistrano-hook'
8
8
  spec.version = Capistrano::Hook::VERSION
9
9
  spec.authors = ['yulii']
10
- spec.email = ['yuliinfo@gmail.com']
10
+ spec.email = ['yone.info@gmail.com']
11
11
 
12
- spec.summary = 'Simple Hook for Capistrano'
13
- spec.description = 'Simple Hook for Capistrano'
12
+ spec.summary = 'Simple hooks for Capistrano deployments.'
13
+ spec.description = 'Notification hooks include start, finish and fail of deployments.'
14
14
  spec.homepage = 'https://github.com/yulii/capistrano-hook'
15
15
  spec.license = 'MIT'
16
16
 
data/config/deploy.rb CHANGED
@@ -3,35 +3,16 @@ lock '3.4.0'
3
3
 
4
4
  set :application, 'capistrano-hook'
5
5
  set :repo_url, 'git@github.com:yulii/capistrano-hook.git'
6
-
7
- # Default branch is :master
8
- # ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp
6
+ set :branch, :master
9
7
 
10
8
  set :deploy_to, '/tmp'
11
9
  set :scm, :git
12
-
13
- # Default value for :format is :pretty
14
- # set :format, :pretty
15
-
16
- # Default value for :log_level is :debug
17
- # set :log_level, :debug
18
-
19
- # Default value for :pty is false
20
- # set :pty, true
21
-
22
- # Default value for :linked_files is []
23
- # set :linked_files, fetch(:linked_files, []).push('config/database.yml', 'config/secrets.yml')
24
-
25
- # Default value for linked_dirs is []
26
- # set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system')
27
-
28
- # Default value for default_env is {}
29
- # set :default_env, { path: "/opt/ruby/bin:$PATH" }
10
+ set :format, :pretty
11
+ set :log_level, :debug
30
12
 
31
13
  set :keep_releases, 5
32
14
 
33
15
  namespace :deploy do
34
-
35
16
  after :restart, :clear_cache do
36
17
  on roles(:web), in: :groups, limit: 3, wait: 10 do
37
18
  # Here we can do anything such as:
@@ -40,5 +21,4 @@ namespace :deploy do
40
21
  # end
41
22
  end
42
23
  end
43
-
44
24
  end
@@ -7,8 +7,6 @@
7
7
  # server 'example.com', user: 'deploy', roles: %w{app web}, other_property: :other_value
8
8
  # server 'db.example.com', user: 'deploy', roles: %w{db}
9
9
 
10
-
11
-
12
10
  # role-based syntax
13
11
  # ==================
14
12
 
@@ -21,14 +19,12 @@
21
19
  # role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value
22
20
  # role :db, %w{deploy@example.com}
23
21
 
24
-
25
-
26
22
  # Configuration
27
23
  # =============
28
- set :webhook_url, 'http://yulii.net/webhook'
29
- set :webhook_starting_payload, { text: '[production] Now, deploying...' }
30
- set :webhook_finished_payload, { text: '[production] Deployment has been completed!' }
31
- set :webhook_failed_payload, { text: '[production] Oops! something went wrong.' }
24
+ set :webhook_url, 'https://yulii.github.io'
25
+ set :webhook_starting_payload, text: '[production] Now, deploying...'
26
+ set :webhook_finished_payload, text: '[production] Deployment has been completed!'
27
+ set :webhook_failed_payload, text: '[production] Oops! something went wrong.'
32
28
 
33
29
  # The server-based syntax can be used to override options:
34
30
  # ------------------------------------
@@ -7,8 +7,6 @@
7
7
  # server 'example.com', user: 'deploy', roles: %w{app web}, other_property: :other_value
8
8
  # server 'db.example.com', user: 'deploy', roles: %w{db}
9
9
 
10
-
11
-
12
10
  # role-based syntax
13
11
  # ==================
14
12
 
@@ -21,8 +19,6 @@
21
19
  # role :web, %w{user1@primary.com user2@additional.com}, other_property: :other_value
22
20
  # role :db, %w{deploy@example.com}
23
21
 
24
-
25
-
26
22
  # Configuration
27
23
  # =============
28
24
  # You can set any configuration variable like in config/deploy.rb
@@ -31,8 +27,6 @@
31
27
  # http://capistranorb.com/documentation/getting-started/configuration/
32
28
  # Feel free to add new variables to customise your setup.
33
29
 
34
-
35
-
36
30
  # Custom SSH Options
37
31
  # ==================
38
32
  # You may pass any option but keep in mind that net/ssh understands a
@@ -1,4 +1,3 @@
1
- require 'capistrano/hook/version'
2
- require 'capistrano/hook/web'
1
+ require 'capistrano/hook/load'
3
2
 
4
3
  load File.expand_path('../tasks/webhook.rake', __FILE__)
@@ -0,0 +1,2 @@
1
+ require 'capistrano/hook/version'
2
+ require 'capistrano/hook/web'
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Hook
3
- VERSION = '0.1.0'.freeze
3
+ VERSION = '0.2.0'.freeze
4
4
  end
5
5
  end
@@ -1,11 +1,10 @@
1
1
  namespace :webhook do
2
-
3
2
  desc <<-DESC
4
3
  Capistrano hook will not be run with no settings.
5
4
 
6
5
  You can setting the variables shown below.
7
6
 
8
- set :webhook_url, 'http://yulii.net/'
7
+ set :webhook_url, 'https://yulii.github.io'
9
8
  set :webhook_starting_payload, { text: 'Now, deploying...' }
10
9
  set :webhook_finished_payload, { text: 'Deployment has been completed!' }
11
10
  set :webhook_failed_payload, { text: 'Oops! something went wrong.' }
@@ -17,7 +16,6 @@ namespace :webhook do
17
16
  end
18
17
 
19
18
  namespace :post do
20
-
21
19
  task :starting do
22
20
  run_locally do
23
21
  url = fetch(:webhook_url)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-hook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - yulii
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-07-29 00:00:00.000000000 Z
11
+ date: 2015-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -108,16 +108,15 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
- description: Simple Hook for Capistrano
111
+ description: Notification hooks include start, finish and fail of deployments.
112
112
  email:
113
- - yuliinfo@gmail.com
113
+ - yone.info@gmail.com
114
114
  executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
118
  - ".gitignore"
119
119
  - ".rubocop.yml"
120
- - ".rubocop_todo.yml"
121
120
  - ".travis.yml"
122
121
  - CODE_OF_CONDUCT.md
123
122
  - Capfile
@@ -128,11 +127,13 @@ files:
128
127
  - bin/console
129
128
  - bin/rubocop-auto-correct
130
129
  - bin/setup
130
+ - bin/test
131
131
  - capistrano-hook.gemspec
132
132
  - config/deploy.rb
133
133
  - config/deploy/production.rb
134
134
  - config/deploy/staging.rb
135
135
  - lib/capistrano/hook.rb
136
+ - lib/capistrano/hook/load.rb
136
137
  - lib/capistrano/hook/version.rb
137
138
  - lib/capistrano/hook/web.rb
138
139
  - lib/capistrano/tasks/webhook.rake
@@ -159,5 +160,5 @@ rubyforge_project:
159
160
  rubygems_version: 2.4.5
160
161
  signing_key:
161
162
  specification_version: 4
162
- summary: Simple Hook for Capistrano
163
+ summary: Simple hooks for Capistrano deployments.
163
164
  test_files: []
data/.rubocop_todo.yml DELETED
@@ -1,43 +0,0 @@
1
- # This configuration was generated by `rubocop --auto-gen-config`
2
- # on 2015-07-29 21:24:29 +0900 using RuboCop version 0.32.1.
3
- # The point is for the user to remove these configuration records
4
- # one by one as the offenses are removed from the code base.
5
- # Note that changes in the inspected code, or installation of new
6
- # versions of RuboCop, may require this file to be generated again.
7
-
8
- # Offense count: 2
9
- # Configuration parameters: AllowURI, URISchemes.
10
- Metrics/LineLength:
11
- Max: 104
12
-
13
- # Offense count: 1
14
- # Configuration parameters: EnforcedStyle, SupportedStyles.
15
- Style/ClassAndModuleChildren:
16
- Enabled: false
17
-
18
- # Offense count: 3
19
- Style/Documentation:
20
- Enabled: false
21
-
22
- # Offense count: 1
23
- # Cop supports --auto-correct.
24
- # Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues.
25
- Style/HashSyntax:
26
- Enabled: false
27
-
28
- # Offense count: 2
29
- # Cop supports --auto-correct.
30
- # Configuration parameters: PreferredDelimiters.
31
- Style/PercentLiteralDelimiters:
32
- Enabled: false
33
-
34
- # Offense count: 20
35
- # Cop supports --auto-correct.
36
- # Configuration parameters: EnforcedStyle, SupportedStyles.
37
- Style/StringLiterals:
38
- Enabled: false
39
-
40
- # Offense count: 2
41
- # Cop supports --auto-correct.
42
- Style/UnneededPercentQ:
43
- Enabled: false