elocal_capistrano 1.0.3 → 1.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 +96 -8
- data/lib/elocal_capistrano/puma.rb +5 -8
- data/lib/elocal_capistrano/version.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e44da0b53e39e4b71de89c31353baef876cfaaa
|
4
|
+
data.tar.gz: c3c47bdc6646f5cbf68da93cfc55e716552ab33b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 60dd8df02036200500b7fff78fe5b61d7c6d44bbed1dfa0063f0101768f34357d56c8166ee5e19ac2e1cbc81bb7dc2a148e5ff7ba8ff290d7f63e1f1c8e2072b
|
7
|
+
data.tar.gz: fe3c939f67f33e61c4c8f325030a35241627d59adecb7b02156f1efddc8c7cb6d29616175b624e776376fb7a0dec7f5072a38243ccbee289bd7b9c94f44c2f5f
|
data/README.md
CHANGED
@@ -1,6 +1,97 @@
|
|
1
|
-
#
|
1
|
+
# Elocal Capistrano
|
2
2
|
|
3
|
-
A bunch of
|
3
|
+
A bunch of handy [Capistrano 2.0](https://github.com/capistrano/capistrano/wiki) tasks.
|
4
|
+
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
### Chef
|
8
|
+
|
9
|
+
cap chef
|
10
|
+
|
11
|
+
Runs chef-client on all servers.
|
12
|
+
|
13
|
+
### Delayed Job
|
14
|
+
|
15
|
+
cap delayed_job:upstart:start
|
16
|
+
cap delayed_job:upstart:restart
|
17
|
+
cap delayed_job:upstart:stop
|
18
|
+
|
19
|
+
Start/stop/restart a delayed job process using upstart. You can change the name of the task with the **delayed\_job\_application_name** variable.
|
20
|
+
|
21
|
+
set(:delayed_job_application_name, 'foobar')
|
22
|
+
|
23
|
+
By default the **#{application}\_delayed\_job** is used.
|
24
|
+
|
25
|
+
|
26
|
+
Generally, this will be hooked in like:
|
27
|
+
|
28
|
+
%w(start stop restart).each do |st|
|
29
|
+
after "deploy:#{st}", "delayed_job:upstart:#{st}"
|
30
|
+
end
|
31
|
+
|
32
|
+
### Deployment Utilities
|
33
|
+
|
34
|
+
cap deploy:symlink_shared_configuration
|
35
|
+
|
36
|
+
This will find files in the directory #{deploy_to}/shared/config and link them in to the release path using the basic logic.
|
37
|
+
|
38
|
+
ln -nfs #{deploy_to}/shared/config/$f #{release_path}/config/$f
|
39
|
+
|
40
|
+
Generally, this will be hooked in with an after callback.
|
41
|
+
|
42
|
+
after "bundle:install", "deploy:symlink_shared_configuration"
|
43
|
+
|
44
|
+
### God
|
45
|
+
|
46
|
+
cap god:start
|
47
|
+
cap god:restart
|
48
|
+
cap god:stop
|
49
|
+
|
50
|
+
Start/stop/restart a god process using. You can change the name of the task with the **god\_application_name** variable.
|
51
|
+
|
52
|
+
set(:god_application_name, 'foobar')
|
53
|
+
|
54
|
+
By default, the application name is used.
|
55
|
+
|
56
|
+
Generally, this will be hooked in like:
|
57
|
+
|
58
|
+
%w(start stop restart).each do |st|
|
59
|
+
after "deploy:#{st}", "god:#{st}"
|
60
|
+
end
|
61
|
+
|
62
|
+
### Maintenance
|
63
|
+
|
64
|
+
cap maintenance:begin
|
65
|
+
cap maintenance:end
|
66
|
+
|
67
|
+
Creates a HTML page at **public/system/503.html**. We rely on Nginx to check for that file and display it for all requests if present.
|
68
|
+
|
69
|
+
### Puma
|
70
|
+
|
71
|
+
cap puma:upstart:start
|
72
|
+
cap puma:upstart:restart
|
73
|
+
cap puma:upstart:stop
|
74
|
+
|
75
|
+
Start/stop/restart a puma process using upstart. You can change the name of the task with the **puma\_application_name** variable.
|
76
|
+
|
77
|
+
set(:puma_application_name, 'foobar')
|
78
|
+
|
79
|
+
By default the **#{application}\_puma** is used.
|
80
|
+
|
81
|
+
Generally, this will be hooked in like:
|
82
|
+
|
83
|
+
%w(start stop restart).each do |st|
|
84
|
+
after "deploy:#{st}", "puma:upstart:#{st}"
|
85
|
+
end
|
86
|
+
|
87
|
+
### Syslog
|
88
|
+
|
89
|
+
cap syslog:grep -s pattern=abc -s all_logs=true
|
90
|
+
|
91
|
+
Utility to grep syslog for a specific pattern.
|
92
|
+
|
93
|
+
* **pattern** - The pattern to match on. Regular expressions are used. This is required.
|
94
|
+
* **all_logs** - If true, all syslogs will be search. If false or unset, only the current log is searched.
|
4
95
|
|
5
96
|
## Installation
|
6
97
|
|
@@ -10,15 +101,12 @@ Add this line to your application's Gemfile:
|
|
10
101
|
|
11
102
|
And then execute:
|
12
103
|
|
13
|
-
$ bundle
|
104
|
+
$ bundle install
|
14
105
|
|
15
|
-
|
106
|
+
In your Capfile add
|
16
107
|
|
17
|
-
|
18
|
-
|
19
|
-
## Usage
|
108
|
+
require 'elocal_capistrano'
|
20
109
|
|
21
|
-
TODO: Write usage instructions here
|
22
110
|
|
23
111
|
## Contributing
|
24
112
|
|
@@ -11,14 +11,11 @@ Capistrano::Configuration.instance.load do
|
|
11
11
|
|
12
12
|
desc 'Perform a restart of the application puma service'
|
13
13
|
task :restart, roles: :app, except: { no_release: true } do
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
sudo reload #{puma_application_name};
|
20
|
-
fi
|
21
|
-
CMD
|
14
|
+
Array(puma_application_name).each do |app_name|
|
15
|
+
run <<-CMD.strip
|
16
|
+
pid=`status #{app_name} | grep -o -E '[0-9]+'`; if [ -z $pid ]; then sudo start #{app_name}; else sudo reload #{app_name}; fi
|
17
|
+
CMD
|
18
|
+
end
|
22
19
|
end
|
23
20
|
end
|
24
21
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elocal_capistrano
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rob Di Marco
|
@@ -14,28 +14,28 @@ dependencies:
|
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.6'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.6'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
description: Common eLocal Capistrano tasks. Supports Capistrano 2.0
|
@@ -45,7 +45,7 @@ executables: []
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
-
-
|
48
|
+
- .gitignore
|
49
49
|
- Gemfile
|
50
50
|
- LICENSE.txt
|
51
51
|
- README.md
|
@@ -70,12 +70,12 @@ require_paths:
|
|
70
70
|
- lib
|
71
71
|
required_ruby_version: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - '>='
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
77
|
requirements:
|
78
|
-
- -
|
78
|
+
- - '>='
|
79
79
|
- !ruby/object:Gem::Version
|
80
80
|
version: '0'
|
81
81
|
requirements: []
|