mina-clockwork 0.0.3 → 1.0.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
  SHA1:
3
- metadata.gz: 769828a7849cb076c9ff3ce576f037a65aca0035
4
- data.tar.gz: 5b32a1ca1c75cf1cd88105ec105e6d1418bd4c8d
3
+ metadata.gz: 387254a2427a26eaade6be5168975b779dd9abd4
4
+ data.tar.gz: 7e959ca0b6cbe1704568e9ab091702ac149b01f9
5
5
  SHA512:
6
- metadata.gz: 985956c6947930e96adc35c397ec882b890f7beca768244b30d7e451cf47294fe936d827a4167048796a25adac29cd2a4570f058a280f6980c9f36540c0ed7d0
7
- data.tar.gz: 320d27d99625cc92081ee89777c06d32684ddf7acb822f75334522032e9818bf8f9dd7bddc98ed7351d971eb1f4213a173b50c3624aabce725d49d7a8ba5b453
6
+ metadata.gz: 4c47b151e42722821a72ed41d22d4fa89bbf0a359df35edbfcbfe6a8419f78fd1963d134a8872d60b047ff2a07d5d688574596b11ce66fb1a1dfe6369a88fef8
7
+ data.tar.gz: 9156439add92479076226a77db1c81a8b80a8d1352a3c0d4ac67a1ea1adbb7dbb71404088fc89f21538d13433e3e27dc202a104bf2cba5154cfa8452f59d2687
data/.gitignore CHANGED
@@ -1,4 +1,5 @@
1
1
  pkg
2
2
  .ruby-version
3
+ .ruby-gemset
3
4
  .bundle
4
5
  Gemfile.lock
data/Gemfile CHANGED
@@ -1,2 +1,8 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
+
2
3
  gemspec
4
+
5
+ group :development do
6
+ gem "bundler"
7
+ gem "rake"
8
+ end
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 clockwork daemon.
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
- ## Installation
6
+ *Important!* You will need both `clockwork` and `daemons` gems available on the server!
6
7
 
7
- Via Bundler:
8
+ ## Installation
8
9
 
9
10
  ```ruby
10
11
  # Gemfile
11
- gem 'mina-clockwork', require: false
12
- ```
13
12
 
14
- PS: You will need the `daemons` gem to use `clockworkd`, be sure that `daemons`
15
- is available in the deployed environment!
13
+ gem "mina-clockwork"
16
14
 
17
- ## Usage example
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 'mina/clockwork'
25
+ require "mina/clockwork"
23
26
 
24
- set :clockwork_file, -> { "#{deploy_to}/#{current_path}/app/clockwork.rb" }
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 'clockwork:stop'
31
- invoke 'git:clone'
31
+ invoke :"clockwork:stop"
32
32
  ...
33
33
 
34
- to :launch do
34
+ on :launch do
35
35
  ...
36
- invoke 'clockwork:start'
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 clockworkd
46
- mina clockwork:start # Start clockworkd
47
- mina clockwork:stop # Stop clockworkd
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 'bundler/gem_tasks'
1
+ require "bundler/gem_tasks"
2
2
 
@@ -1,34 +1,47 @@
1
- require 'mina/bundler'
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
- namespace :clockwork do
4
- set_default :clockwork_dir, -> { "#{deploy_to}/#{current_path}" }
5
- set_default :clockwork_file, -> { "#{deploy_to}/#{current_path}/clock.rb" }
6
- set_default :clockwork_identifier, -> { File.basename(clockwork_file, '.rb') }
7
- set_default :clockwork_pid_dir, -> { "#{deploy_to}/#{shared_path}/tmp/pids" }
8
- set_default :clockwork_log_dir, -> { "#{deploy_to}/#{shared_path}/log" }
9
- set_default :clockworkd_cmd, -> { "#{bundle_prefix} clockworkd" }
10
- set_default :clockworkd_full_cmd, -> { %[cd #{deploy_to}/#{current_path} && #{clockworkd_cmd} \\
11
- -c '#{clockwork_file}' \\
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
- desc 'Start clockworkd'
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
- queue %[echo '-----> Start clockwork']
20
- queue! "#{clockworkd_full_cmd} start"
30
+ comment "Starting clockwork daemon"
31
+ command "#{fetch(:clockworkd_full_cmd)} start"
21
32
  end
22
33
 
23
- desc 'Stop clockworkd'
34
+ # mina clockwork:stop
35
+ desc "Stop clockwork daemon"
24
36
  task stop: :environment do
25
- queue %[echo '-----> Stop clockwork']
26
- queue! "#{clockworkd_full_cmd} stop"
37
+ comment "Stopping clockwork daemon"
38
+ command "#{fetch(:clockworkd_full_cmd)} stop"
27
39
  end
28
40
 
29
- desc 'Restart clockworkd'
41
+ # mina clockwork:restart
42
+ desc "Restart clockwork daemon"
30
43
  task restart: :environment do
31
- queue %[echo '-----> Restart clockwork']
32
- queue! "#{clockworkd_full_cmd} restart"
44
+ comment "Restarting clockwork daemon"
45
+ command "#{fetch(:clockworkd_full_cmd)} restart"
33
46
  end
34
47
  end
@@ -1,5 +1,5 @@
1
1
  module Mina
2
2
  module Clockwork
3
- VERSION = '0.0.3'
3
+ VERSION = "1.0.0"
4
4
  end
5
5
  end
@@ -1,2 +1,2 @@
1
- require 'mina/clockwork/version'
2
- require 'mina/clockwork/tasks'
1
+ require "mina/clockwork/version"
2
+ require "mina/clockwork/tasks"
@@ -1,27 +1,23 @@
1
- # encoding: utf-8
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
- require 'mina/clockwork/version'
3
+
4
+ require "mina/clockwork/version"
6
5
 
7
6
  Gem::Specification.new do |spec|
8
- spec.name = 'mina-clockwork'
7
+ spec.name = "mina-clockwork"
9
8
  spec.version = Mina::Clockwork::VERSION
10
- spec.authors = ['Alexey Chernenkov']
11
- spec.email = ['laise@pisem.net']
12
- spec.summary = 'Clockwork deployment scenario for mina.'
13
- spec.description = ''
14
- spec.homepage = 'https://github.com/907th/mina-clockwork'
15
- spec.license = 'MIT'
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 = ['lib']
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 'clockwork'
26
- spec.add_dependency 'daemons'
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.3
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: 2014-07-31 00:00:00.000000000 Z
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: daemons
28
+ name: mina
57
29
  requirement: !ruby/object:Gem::Requirement
58
30
  requirements:
59
31
  - - ">="
60
32
  - !ruby/object:Gem::Version
61
- version: '0'
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: '0'
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.2.2
77
+ rubygems_version: 2.6.8
106
78
  signing_key:
107
79
  specification_version: 4
108
80
  summary: Clockwork deployment scenario for mina.