capistrano-eye 0.0.2 → 0.0.4

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: a99dfff22ac7fca7975b6704abb89e2bb71d8c9a
4
- data.tar.gz: 29cff9a5ca4649288540c10795ff1f4b7bdd6580
3
+ metadata.gz: 6da79ec37960592b46ec921762fe026e4d244c80
4
+ data.tar.gz: 10e5de371e55fb3c124260615e40d24529ff3f88
5
5
  SHA512:
6
- metadata.gz: 95b624418c22ba87b2426432604751caed43f791f9e87b7e497ed7222fc8e01f9c885d837ee933e4841c7797fde99f9a12f1d2e22aa7af13f2ac16d3033129c6
7
- data.tar.gz: 4443063e0f88ab9caee33d7613cad59f9af6acde1b5f4497dafc3e662b04b039ce927b3f7e221f72f23073eec177b6d6542fa1088295ae2a9a38011086c4b590
6
+ metadata.gz: e19c30a4d4d3a8cf6935e288ee5a95ae927fbce57ffabe5b5b468b2d8e9a46c8fcd4426c2acd5e3aabd714a67ea79ee909d65d1848dded6c0bfaad6aaed7cb29
7
+ data.tar.gz: dca49263c531ddbf46f8640c60aa5b1ddfd70e7ad16984148812ec41c45e2c10d92ac1771014fddd7b01421dad854feac967bff5e24ef1b9ff3976a8b3b6c64b
data/README.md CHANGED
@@ -4,13 +4,37 @@ Wrap all application processes by [eye]('https://github.com/kostya/eye') monitor
4
4
 
5
5
  ## Installation
6
6
 
7
+ Add this line to your Gemfile:
7
8
 
8
- gem 'capistrano-eye', github: 'alexsergeyev/capistrano-eye'
9
+ ```ruby
10
+ gem 'capistrano-eye'
11
+ ```
9
12
 
10
- Enable it in Capfile
13
+ And then run:
11
14
 
12
- require 'capistrano/eye'
15
+ ```bash
16
+ $ bundle
17
+ ```
13
18
 
19
+ ## Usage
20
+
21
+ Add this line to your `Capfile` and `deploy:restart` will be setup to automatically run after `:publishing` is complete:
22
+
23
+ ```ruby
24
+ require 'capistrano/eye'
25
+ ```
26
+
27
+ The following tasks are available: `eye:load`, `eye:start`, `eye:stop`, `eye:restart`, `eye:info`
28
+
29
+ If you want the task to run at a different point in your deployment, require `capistrano/eye/no_hook` instead of `capistrano/eye` and then add your own hook in `config/deploy.rb`.
30
+
31
+ ``` ruby
32
+ # Capfile
33
+ require 'capistrano/eye/no_hook'
34
+
35
+ # config/deploy.rb
36
+ after :some_other_task, :'eye:restart'
37
+ ```
14
38
 
15
39
  ## Configuration
16
40
  set :eye_application # capistrano application name by default
@@ -1,10 +1,11 @@
1
1
  # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'capistrano/eye/version'
4
5
 
5
6
  Gem::Specification.new do |gem|
6
7
  gem.name = 'capistrano-eye'
7
- gem.version = '0.0.2'
8
+ gem.version = Capistrano::Eye::VERSION
8
9
  gem.authors = ['Alex Sergeyev']
9
10
  gem.email = ['alex.sergeyev@gmail.com']
10
11
  gem.summary = %q(Capistrano eye tasks)
@@ -1 +1 @@
1
- load File.expand_path("../tasks/eye.rake", __FILE__)
1
+ load File.expand_path("../tasks/deploy_eye.cap", __FILE__)
@@ -0,0 +1 @@
1
+ load File.expand_path("../../tasks/eye.cap", __FILE__)
@@ -0,0 +1,5 @@
1
+ module Capistrano
2
+ module Eye
3
+ VERSION = '0.0.4'
4
+ end
5
+ end
@@ -0,0 +1,10 @@
1
+ load File.expand_path('../eye.cap', __FILE__)
2
+
3
+ namespace :deploy do
4
+ desc 'Restart your Eye application'
5
+ task :restart do
6
+ invoke 'eye:restart'
7
+ end
8
+ after :publishing, :restart
9
+ end
10
+
@@ -0,0 +1,49 @@
1
+ namespace :eye do
2
+ desc 'Load eye config'
3
+ task :load do
4
+ on roles(fetch(:eye_roles)) do
5
+ with fetch(:eye_env) do
6
+ within(release_path) do
7
+ execute :eye, :load, fetch(:eye_config)
8
+ end
9
+ end
10
+ end
11
+ end
12
+
13
+ %i(start stop restart).each do |cmd|
14
+ desc "Run 'eye #{cmd}'"
15
+ task cmd do
16
+ on roles(fetch(:eye_roles)) do
17
+ with fetch(:eye_env) do
18
+ within(release_path) do
19
+ execute :eye, cmd, fetch(:eye_application)
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+
26
+ task :info do
27
+ desc 'Show application status'
28
+ on roles(fetch(:eye_roles)) do |server|
29
+ puts server.hostname
30
+ with fetch(:eye_env) do
31
+ within(release_path) do
32
+ puts capture(:eye, :info, fetch(:eye_application))
33
+ end
34
+ end
35
+ end
36
+ end
37
+
38
+ before :start, :load
39
+ before :restart, :load
40
+ end
41
+
42
+ namespace :load do
43
+ task :defaults do
44
+ set :eye_roles, :app
45
+ set :eye_env, -> { { rails_env: fetch(:stage) } }
46
+ set :eye_application, -> { fetch(:application) }
47
+ set :eye_config, -> { "./config/#{fetch(:application)}.eye" }
48
+ end
49
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-eye
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Sergeyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-13 00:00:00.000000000 Z
11
+ date: 2015-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -53,7 +53,10 @@ files:
53
53
  - capistrano-eye.gemspec
54
54
  - lib/capistrano-eye.rb
55
55
  - lib/capistrano/eye.rb
56
- - lib/capistrano/tasks/eye.rake
56
+ - lib/capistrano/eye/no_hook.rb
57
+ - lib/capistrano/eye/version.rb
58
+ - lib/capistrano/tasks/deploy_eye.cap
59
+ - lib/capistrano/tasks/eye.cap
57
60
  homepage: http://github.com/alexsergeyev/capistrano-eye
58
61
  licenses:
59
62
  - MIT
@@ -74,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
77
  version: '0'
75
78
  requirements: []
76
79
  rubyforge_project:
77
- rubygems_version: 2.2.2
80
+ rubygems_version: 2.4.5
78
81
  signing_key:
79
82
  specification_version: 4
80
83
  summary: Capistrano eye tasks
@@ -1,23 +0,0 @@
1
- namespace :eye do
2
- task :load do
3
- on release_roles(:app) do
4
- within(release_path) do
5
- execute :mkdir, "-pv", "$HOME/eye"
6
- execute :eye, :load, fetch(:eye_config, "./config/#{fetch(:application)}.eye")
7
- end
8
- end
9
- end
10
-
11
- %w(start stop restart info).each do |cmd|
12
- task cmd.to_sym do
13
- on roles(:app) do
14
- execute :eye, cmd.to_sym, fetch(:eye_application, fetch(:application))
15
- end
16
- end
17
- end
18
-
19
- before :start, :load
20
- before :restart, :load
21
- end
22
-
23
- after 'deploy:publishing', 'eye:restart'