capistrano-eye 0.0.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +27 -3
- data/capistrano-eye.gemspec +2 -1
- data/lib/capistrano/eye.rb +1 -1
- data/lib/capistrano/eye/no_hook.rb +1 -0
- data/lib/capistrano/eye/version.rb +5 -0
- data/lib/capistrano/tasks/deploy_eye.cap +10 -0
- data/lib/capistrano/tasks/eye.cap +49 -0
- metadata +7 -4
- data/lib/capistrano/tasks/eye.rake +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6da79ec37960592b46ec921762fe026e4d244c80
|
4
|
+
data.tar.gz: 10e5de371e55fb3c124260615e40d24529ff3f88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
9
|
+
```ruby
|
10
|
+
gem 'capistrano-eye'
|
11
|
+
```
|
9
12
|
|
10
|
-
|
13
|
+
And then run:
|
11
14
|
|
12
|
-
|
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
|
data/capistrano-eye.gemspec
CHANGED
@@ -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 =
|
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)
|
data/lib/capistrano/eye.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
load File.expand_path("../tasks/
|
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,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.
|
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:
|
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/
|
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.
|
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'
|