mina-clockwork 0.0.3 → 1.0.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 +4 -4
- data/.gitignore +1 -0
- data/Gemfile +7 -1
- data/README.md +34 -27
- data/Rakefile +1 -1
- data/lib/mina/clockwork/tasks.rb +36 -23
- data/lib/mina/clockwork/version.rb +1 -1
- data/lib/mina/clockwork.rb +2 -2
- data/mina-clockwork.gemspec +13 -17
- metadata +6 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 387254a2427a26eaade6be5168975b779dd9abd4
|
4
|
+
data.tar.gz: 7e959ca0b6cbe1704568e9ab091702ac149b01f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c47b151e42722821a72ed41d22d4fa89bbf0a359df35edbfcbfe6a8419f78fd1963d134a8872d60b047ff2a07d5d688574596b11ce66fb1a1dfe6369a88fef8
|
7
|
+
data.tar.gz: 9156439add92479076226a77db1c81a8b80a8d1352a3c0d4ac67a1ea1adbb7dbb71404088fc89f21538d13433e3e27dc202a104bf2cba5154cfa8452f59d2687
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,59 +1,66 @@
|
|
1
|
-
# Mina Clockwork
|
1
|
+
# Mina + Clockwork
|
2
2
|
|
3
|
-
Clockwork deployment scenario for mina. It uses `clockworkd` to start
|
3
|
+
Clockwork deployment scenario for mina. It uses `clockworkd` executable to start
|
4
|
+
clockwork daemon on the server. `clockworkd` is the part of the [`clockwork`](https://github.com/Rykian/clockwork).
|
4
5
|
|
5
|
-
|
6
|
+
*Important!* You will need both `clockwork` and `daemons` gems available on the server!
|
6
7
|
|
7
|
-
|
8
|
+
## Installation
|
8
9
|
|
9
10
|
```ruby
|
10
11
|
# Gemfile
|
11
|
-
gem 'mina-clockwork', require: false
|
12
|
-
```
|
13
12
|
|
14
|
-
|
15
|
-
is available in the deployed environment!
|
13
|
+
gem "mina-clockwork"
|
16
14
|
|
17
|
-
|
15
|
+
group :production do
|
16
|
+
gem "daemons" # for `clockworkd`
|
17
|
+
end
|
18
|
+
```
|
19
|
+
|
20
|
+
## Configuration
|
18
21
|
|
19
22
|
```ruby
|
20
23
|
# config/deploy.rb
|
21
24
|
|
22
|
-
require
|
25
|
+
require "mina/clockwork"
|
23
26
|
|
24
|
-
set
|
25
|
-
set :clockwork_identifier, -> { rails_env }
|
26
|
-
... other options
|
27
|
+
... set configuration options here if you need ...
|
27
28
|
|
28
29
|
task deploy: :environment do
|
29
30
|
deploy do
|
30
|
-
invoke
|
31
|
-
invoke 'git:clone'
|
31
|
+
invoke :"clockwork:stop"
|
32
32
|
...
|
33
33
|
|
34
|
-
|
34
|
+
on :launch do
|
35
35
|
...
|
36
|
-
invoke
|
36
|
+
invoke :"clockwork:start"
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
40
40
|
```
|
41
41
|
|
42
|
+
Use these options to configure the plugin:
|
43
|
+
|
44
|
+
* `clockwork_dir` - Daemon working dir (Default: current deployment path)
|
45
|
+
* `clockwork_file` - Clock file (Default: [current deployment path]/clock.rb)
|
46
|
+
* `clockwork_identifier` - Identifier of the `clockworkd` process (Default: name of the clock file)
|
47
|
+
* `clockwork_pid_dir` - Dir for `*.pid` file (Default: [shared path]/tmp/pids)
|
48
|
+
* `clockwork_log_dir` - Dir for `*.log` files (Default: [shared path]/log)
|
49
|
+
|
50
|
+
Example:
|
51
|
+
|
52
|
+
```ruby
|
53
|
+
set :clockwork_file, -> { "#{fetch(:current_path)}/my_clock_file.rb" }
|
54
|
+
```
|
55
|
+
|
42
56
|
## Tasks
|
43
57
|
|
44
58
|
```
|
45
|
-
mina clockwork:restart # Restart
|
46
|
-
mina clockwork:start # Start
|
47
|
-
mina clockwork:stop # Stop
|
59
|
+
mina clockwork:restart # Restart clockwork daemon
|
60
|
+
mina clockwork:start # Start clockwork daemon
|
61
|
+
mina clockwork:stop # Stop clockwork daemon
|
48
62
|
```
|
49
63
|
|
50
|
-
## Configuration
|
51
|
-
|
52
|
-
* `clockwork_dir` - Working dir (Default: current deployment path)
|
53
|
-
* `clockwork_file` - Clock file (Default: [current deployment path]/clock.rb)
|
54
|
-
* `clockwork_identifier` - Identifier for clockworkd process (Default: name of clock file)
|
55
|
-
* `clockwork_pid_dir` - Dir for pid file (Default: [shared path]/tmp/pids)
|
56
|
-
* `clockwork_log_dir` - Dir for log files (Default: [shared path]/log)
|
57
64
|
|
58
65
|
## Contributing
|
59
66
|
|
data/Rakefile
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
require
|
1
|
+
require "bundler/gem_tasks"
|
2
2
|
|
data/lib/mina/clockwork/tasks.rb
CHANGED
@@ -1,34 +1,47 @@
|
|
1
|
-
|
1
|
+
set :clockwork_dir, -> { "#{fetch(:current_path)}" }
|
2
|
+
set :clockwork_file, -> { "#{fetch(:current_path)}/clock.rb" }
|
3
|
+
set :clockwork_identifier, -> { File.basename(clockwork_file, ".rb") }
|
4
|
+
set :clockwork_pid_dir, -> { "#{fetch(:shared_path)}/tmp/pids" }
|
5
|
+
set :clockwork_log_dir, -> { "#{fetch(:shared_path)}/log" }
|
2
6
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
-i '#{clockwork_identifier}' \\
|
13
|
-
-d '#{clockwork_dir}' \\
|
14
|
-
--pid-dir '#{clockwork_pid_dir}' \\
|
15
|
-
--log --log-dir '#{clockwork_log_dir}'] }
|
7
|
+
set :clockworkd_cmd, -> {
|
8
|
+
if set?(:bundle_prefix)
|
9
|
+
"#{fetch(:bundle_prefix)} clockworkd"
|
10
|
+
elsif set?(:bundle_bin)
|
11
|
+
"#{fetch(:bundle_bin)} exec clockworkd"
|
12
|
+
else
|
13
|
+
"clockworkd"
|
14
|
+
end
|
15
|
+
}
|
16
16
|
|
17
|
-
|
17
|
+
set :clockworkd_full_cmd, -> {
|
18
|
+
%[cd #{fetch(:current_path)} && #{fetch(:clockworkd_cmd)} \\
|
19
|
+
-c '#{fetch(:clockwork_file)}' \\
|
20
|
+
-i '#{fetch(:clockwork_identifier)}' \\
|
21
|
+
-d '#{fetch(:clockwork_dir)}' \\
|
22
|
+
--pid-dir '#{fetch(:clockwork_pid_dir)}' \\
|
23
|
+
--log --log-dir '#{fetch(:clockwork_log_dir)}']
|
24
|
+
}
|
25
|
+
|
26
|
+
namespace :clockwork do
|
27
|
+
# mina clockwork:start
|
28
|
+
desc "Start clockwork daemon"
|
18
29
|
task start: :environment do
|
19
|
-
|
20
|
-
|
30
|
+
comment "Starting clockwork daemon"
|
31
|
+
command "#{fetch(:clockworkd_full_cmd)} start"
|
21
32
|
end
|
22
33
|
|
23
|
-
|
34
|
+
# mina clockwork:stop
|
35
|
+
desc "Stop clockwork daemon"
|
24
36
|
task stop: :environment do
|
25
|
-
|
26
|
-
|
37
|
+
comment "Stopping clockwork daemon"
|
38
|
+
command "#{fetch(:clockworkd_full_cmd)} stop"
|
27
39
|
end
|
28
40
|
|
29
|
-
|
41
|
+
# mina clockwork:restart
|
42
|
+
desc "Restart clockwork daemon"
|
30
43
|
task restart: :environment do
|
31
|
-
|
32
|
-
|
44
|
+
comment "Restarting clockwork daemon"
|
45
|
+
command "#{fetch(:clockworkd_full_cmd)} restart"
|
33
46
|
end
|
34
47
|
end
|
data/lib/mina/clockwork.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require "mina/clockwork/version"
|
2
|
+
require "mina/clockwork/tasks"
|
data/mina-clockwork.gemspec
CHANGED
@@ -1,27 +1,23 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
lib = File.expand_path('../lib', __FILE__)
|
1
|
+
lib = File.expand_path("../lib", __FILE__)
|
4
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
-
|
3
|
+
|
4
|
+
require "mina/clockwork/version"
|
6
5
|
|
7
6
|
Gem::Specification.new do |spec|
|
8
|
-
spec.name =
|
7
|
+
spec.name = "mina-clockwork"
|
9
8
|
spec.version = Mina::Clockwork::VERSION
|
10
|
-
spec.authors = [
|
11
|
-
spec.email = [
|
12
|
-
spec.summary =
|
13
|
-
spec.description =
|
14
|
-
spec.homepage =
|
15
|
-
spec.license =
|
9
|
+
spec.authors = ["Alexey Chernenkov"]
|
10
|
+
spec.email = ["laise@pisem.net"]
|
11
|
+
spec.summary = "Clockwork deployment scenario for mina."
|
12
|
+
spec.description = ""
|
13
|
+
spec.homepage = "https://github.com/907th/mina-clockwork"
|
14
|
+
spec.license = "MIT"
|
16
15
|
|
17
16
|
spec.files = `git ls-files -z`.split("\x0")
|
18
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
19
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
|
-
spec.require_paths = [
|
21
|
-
|
22
|
-
spec.add_development_dependency 'bundler', '~> 1.6'
|
23
|
-
spec.add_development_dependency 'rake'
|
19
|
+
spec.require_paths = ["lib"]
|
24
20
|
|
25
|
-
spec.add_dependency
|
26
|
-
spec.add_dependency
|
21
|
+
spec.add_dependency "clockwork"
|
22
|
+
spec.add_dependency "mina", ">= 1.0.2"
|
27
23
|
end
|
metadata
CHANGED
@@ -1,43 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mina-clockwork
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexey Chernenkov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.6'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.6'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
13
|
- !ruby/object:Gem::Dependency
|
42
14
|
name: clockwork
|
43
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -53,19 +25,19 @@ dependencies:
|
|
53
25
|
- !ruby/object:Gem::Version
|
54
26
|
version: '0'
|
55
27
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
28
|
+
name: mina
|
57
29
|
requirement: !ruby/object:Gem::Requirement
|
58
30
|
requirements:
|
59
31
|
- - ">="
|
60
32
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
33
|
+
version: 1.0.2
|
62
34
|
type: :runtime
|
63
35
|
prerelease: false
|
64
36
|
version_requirements: !ruby/object:Gem::Requirement
|
65
37
|
requirements:
|
66
38
|
- - ">="
|
67
39
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
40
|
+
version: 1.0.2
|
69
41
|
description: ''
|
70
42
|
email:
|
71
43
|
- laise@pisem.net
|
@@ -102,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
74
|
version: '0'
|
103
75
|
requirements: []
|
104
76
|
rubyforge_project:
|
105
|
-
rubygems_version: 2.
|
77
|
+
rubygems_version: 2.6.8
|
106
78
|
signing_key:
|
107
79
|
specification_version: 4
|
108
80
|
summary: Clockwork deployment scenario for mina.
|