capistrano-anycable 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2cadc4f5cf54bcb4c678d188e87c051ebc40938208dfe77c2f754af3a187674f
4
- data.tar.gz: 3fff761445c786fbdcef23a435dc168bf3af1eaa20488a654df5ab237b1b7927
3
+ metadata.gz: 19e776a35ab7eac2014e216dfaed84d5ba69bc79682f01c978f07f4306bf9920
4
+ data.tar.gz: 73456cb12315894f6085b498504dd674a20493d4c524b1da5f03f47563d78713
5
5
  SHA512:
6
- metadata.gz: 93d7c4814b2ffdfa8fffafe5438fb470c78c9924e698c5cd2a11348e1501ef57a2042dcaf2664cbfc47783e5c49c82880215c8d6f3719112d94344f363ca599a
7
- data.tar.gz: 2170556b0a7835551878b7324287869bfd128fcb5092a3d1c87fea7b8702531ef1626cc870422a53dff068fc6536b59e6bebe92221b7f1d7b14b5a48ea555497
6
+ metadata.gz: f5317506c6b085393a803c8cd15d7e100c813ef7cee57e23865e34c7775de6e38711ee0f885e2eac48ab835f3b406069ff029d994f03420489529cae4db00473
7
+ data.tar.gz: 87a38c8db9dbc971d685b0feafcac45b15e656717525b6607baaa60f7b1c8538f2d7bafab4db074507420c43801accf061363bcfae023580eca14bc9063bb41e
data/README.md CHANGED
@@ -1,12 +1,23 @@
1
+ [![Gem Version](https://badge.fury.io/rb/capistrano-anycable.svg)](https://rubygems.org/gems/capistrano-anycable) [![Build Status](https://travis-ci.org/anycable/capistrano-anycable.svg?branch=master)](https://travis-ci.org/anycable/capistrano-anycable)
2
+ [![Documentation](https://img.shields.io/badge/docs-link-brightgreen.svg)](https://docs.anycable.io/#capistrano)
3
+
4
+
1
5
  # Capistrano::Anycable
2
6
 
3
7
  AnyCable integration for Capistrano.
4
8
 
9
+ # Requirements
10
+
11
+ AnyCable >= 0.6.2
12
+
5
13
  ## Installation
6
14
 
7
- Add this line to your application's Gemfile:
15
+ Add those lines to your application's Gemfile:
8
16
 
9
17
  ```ruby
18
+ # To run daemonized `anycabled`
19
+ gem "daemons", "~> 1.3", require: false
20
+
10
21
  gem "capistrano-anycable", group: :development
11
22
  ```
12
23
 
@@ -23,7 +34,29 @@ $ bundle
23
34
  require "capistrano/anycable"
24
35
  ```
25
36
 
26
- TBD
37
+ ## Configuration
38
+
39
+ Available configuration options (with defaults):
40
+
41
+ ```ruby
42
+ # Restart AnyCable after `deploy:restart` phase
43
+ set :anycable_default_hooks, true
44
+
45
+ # Capistrano roles to start AnyCable on
46
+ set :anycable_roles, :app
47
+ # Path to the root of your application
48
+ set :anycable_path, -> { release_path }
49
+ # Command to start AnyCable
50
+ set :anycable_command, -> { [:bundle, :exec, :anycabled] }
51
+
52
+ # Sets RAILS_ENV for AnyCable process
53
+ set :anycable_env, -> { fetch(:rack_env, fetch(:rails_env, fetch(:stage))) }
54
+ # AnyCable configuration parameters passed through enviroment,
55
+ # see https://docs.anycable.io/#/ruby/configuration?id=parameters
56
+ set :anycable_environment_variables, {}
57
+ # Path to anycable.yml
58
+ set :anycable_conf, nil
59
+ ```
27
60
 
28
61
  ## Contributing
29
62
 
File without changes
@@ -1,3 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "capistrano/anycable/version"
3
+ load File.expand_path("../tasks/anycable.rake", __FILE__)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Capistrano
4
4
  module AnyCable
5
- VERSION = "0.0.1"
5
+ VERSION = "0.1.0"
6
6
  end
7
7
  end
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ namespace :load do
4
+ task :defaults do
5
+ set :anycable_default_hooks, true
6
+
7
+ set :anycable_roles, :app
8
+ set :anycable_path, -> { release_path }
9
+ set :anycable_command, -> { [:bundle, :exec, :anycabled] }
10
+
11
+ set :anycable_env, -> { fetch(:rack_env, fetch(:rails_env, fetch(:stage))) }
12
+ set :anycable_environment_variables, {}
13
+ set :anycable_conf, nil
14
+
15
+ # For internal use only
16
+ set :_anycable_environment, -> do
17
+ fetch(:default_env).merge(fetch(:anycable_environment_variables)).merge(
18
+ {
19
+ rails_env: fetch(:anycable_env),
20
+ anycable_conf: fetch(:anycable_conf)
21
+ }.compact
22
+ )
23
+ end
24
+ end
25
+ end
26
+
27
+ namespace :deploy do
28
+ before :starting, :check_anycable_hooks do
29
+ invoke "anycable:add_default_hooks" if fetch(:anycable_default_hooks)
30
+ end
31
+ end
32
+
33
+ namespace :anycable do
34
+ task :add_default_hooks do
35
+ after "deploy:restart", "anycable:restart"
36
+ end
37
+
38
+ desc "Start anycable process"
39
+ task :start do
40
+ anycabled :start
41
+ end
42
+
43
+ desc "Stop anycable process"
44
+ task :stop do
45
+ anycabled :stop
46
+ end
47
+
48
+ desc "Restart anycable process"
49
+ task :restart do
50
+ anycabled :restart
51
+ end
52
+
53
+ def anycabled(command)
54
+ on roles fetch(:anycable_roles) do
55
+ within fetch(:anycable_path) do
56
+ with fetch(:_anycable_environment) do
57
+ execute(*fetch(:anycable_command), command)
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-anycable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Ponomarev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-06 00:00:00.000000000 Z
11
+ date: 2019-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -89,8 +89,10 @@ extra_rdoc_files: []
89
89
  files:
90
90
  - LICENSE.txt
91
91
  - README.md
92
+ - lib/capistrano-anycable.rb
92
93
  - lib/capistrano/anycable.rb
93
94
  - lib/capistrano/anycable/version.rb
95
+ - lib/capistrano/tasks/anycable.rake
94
96
  homepage: http://github.com/anycable/capistrano-anycable
95
97
  licenses:
96
98
  - MIT
@@ -110,8 +112,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
110
112
  - !ruby/object:Gem::Version
111
113
  version: '0'
112
114
  requirements: []
113
- rubyforge_project:
114
- rubygems_version: 2.7.6
115
+ rubygems_version: 3.0.2
115
116
  signing_key:
116
117
  specification_version: 4
117
118
  summary: AnyCable integration for Capistrano