mina-sneakers 0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e75a7663e99a51e2acaffef9533e4e395b94f70f
4
+ data.tar.gz: e909986230cb085ca72be255eb4b55441900c6cd
5
+ SHA512:
6
+ metadata.gz: a254de792151b2323d2e07b3e1d4c5d88b85b2f0e8a8b27e9075724b4b3fcef16c9f1247fd95d1f1f25eefd20902deab31fe95534e2dc18799c4db2ffeb1a1c8
7
+ data.tar.gz: 26e0316d4ce883f84ff4c28c94ba1ec53dfe3ac0d793665475407fcba505a2ed8d2494178230be6f4f80dafe19c530322cedbc0e686b3903766c6a94ca21aee5
data/.gitignore ADDED
@@ -0,0 +1,50 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /spec/examples.txt
9
+ /test/tmp/
10
+ /test/version_tmp/
11
+ /tmp/
12
+
13
+ # Used by dotenv library to load environment variables.
14
+ # .env
15
+
16
+ ## Specific to RubyMotion:
17
+ .dat*
18
+ .repl_history
19
+ build/
20
+ *.bridgesupport
21
+ build-iPhoneOS/
22
+ build-iPhoneSimulator/
23
+
24
+ ## Specific to RubyMotion (use of CocoaPods):
25
+ #
26
+ # We recommend against adding the Pods directory to your .gitignore. However
27
+ # you should judge for yourself, the pros and cons are mentioned at:
28
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
29
+ #
30
+ # vendor/Pods/
31
+
32
+ ## Documentation cache and generated files:
33
+ /.yardoc/
34
+ /_yardoc/
35
+ /doc/
36
+ /rdoc/
37
+
38
+ ## Environment normalization:
39
+ /.bundle/
40
+ /vendor/bundle
41
+ /lib/bundler/man/
42
+
43
+ # for a library or gem, you might want to ignore these files since the code is
44
+ # intended to run in multiple environments; otherwise, check them in:
45
+ # Gemfile.lock
46
+ # .ruby-version
47
+ # .ruby-gemset
48
+
49
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
50
+ .rvmrc
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in mina-sneakers.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2017 Vladimir Sharshov
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,57 @@
1
+ # Mina Sneakers
2
+
3
+ [Mina](https://github.com/nadarei/mina) tasks for handle with
4
+ [Sneakers](https://github.com/jondot/sneakers).
5
+
6
+ This gem provides several mina tasks:
7
+
8
+ mina sneakers:kill # Kill sneakers
9
+ mina sneakers:phased_restart # Restart sneakers (phased restart)
10
+ mina sneakers:restart # Restart sneakers
11
+ mina sneakers:start # Start sneakers
12
+ mina sneakers:stop # Stop sneakers
13
+
14
+ ## Installation
15
+
16
+ Add this line to your application's Gemfile:
17
+
18
+ gem 'mina-sneakers', git: 'https://github.com/warpc/mina-sneakers', require: false
19
+
20
+ And then execute:
21
+
22
+ $ bundle
23
+
24
+ ## Usage
25
+
26
+ Add this to your `config/deploy.rb` file:
27
+
28
+ require 'mina/sneakers'
29
+
30
+ Warning: sneakers daemon option should be true for environment which
31
+ plan to deploy using mina
32
+
33
+ ## Example
34
+ ```ruby
35
+ require 'mina/sneakers'
36
+
37
+ task :deploy do
38
+ deploy do
39
+ invoke :'git:clone'
40
+ invoke :'deploy:link_shared_paths'
41
+ ...
42
+
43
+ on :launch do
44
+ ...
45
+ invoke :'sneakers:phased_restart'
46
+ end
47
+ end
48
+ end
49
+ ```
50
+
51
+ ## Contributing
52
+
53
+ 1. Fork it
54
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
55
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
56
+ 4. Push to the branch (`git push origin my-new-feature`)
57
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1 @@
1
+ load File.expand_path('../sneakers/tasks.rake', __FILE__)
@@ -0,0 +1,87 @@
1
+ require 'mina/bundler'
2
+ require 'mina/rails'
3
+
4
+ namespace :sneakers do
5
+ set :sneakers_env, -> { fetch(:rails_env, 'production') }
6
+ set :sneakers_pid, -> { "#{fetch(:shared_path)}/tmp/pids/sneakers.pid" }
7
+ set :sneakers_run_cmd, -> { "#{fetch(:bundle_prefix)} rake sneakers:run" }
8
+
9
+ desc 'Start sneakers'
10
+ task start: :environment do
11
+ comment 'Sneakers starting ...'
12
+ in_path(fetch(:current_path)) do
13
+ command fetch(:sneakers_run_cmd)
14
+ end
15
+ end
16
+
17
+ desc 'Stop sneakers'
18
+ task stop: :environment do
19
+ comment 'Sneakers stopping ...'
20
+ command %{
21
+ if [ -e "#{fetch(:sneakers_pid)}" ]; then
22
+ if [ -e /proc/$(cat '#{fetch(:sneakers_pid)}') ]; then
23
+ kill -INT `cat '#{fetch(:sneakers_pid)}'`
24
+ else
25
+ echo 'Sneakers stopped!';
26
+ fi
27
+ else
28
+ echo 'Sneakers is not running!';
29
+ fi
30
+ }
31
+ end
32
+
33
+ desc 'Hard stop sneakers'
34
+ task hard_stop: :environment do
35
+ comment 'Sneakers stopping --hard ...'
36
+ command %{
37
+ if [ -e "#{fetch(:sneakers_pid)}" ]; then
38
+ if [ -e /proc/$(cat '#{fetch(:sneakers_pid)}') ]; then
39
+ kill -9 `cat '#{fetch(:sneakers_pid)}'`
40
+ else
41
+ echo 'Sneakers stopped!';
42
+ fi
43
+ else
44
+ echo 'Sneakers is not running!';
45
+ fi
46
+ }
47
+ end
48
+
49
+ desc 'Get status of sneakers'
50
+ task status: :environment do
51
+ comment 'Sneakers status...'
52
+ command %{
53
+ if [ -e "#{fetch(:sneakers_pid)}" ]; then
54
+ if [ -e /proc/$(cat '#{fetch(:sneakers_pid)}') ]; then
55
+ echo 'Sneakers is running'
56
+ else
57
+ echo 'Sneakers stopped';
58
+ fi
59
+ else
60
+ echo 'Sneakers not running';
61
+ fi
62
+ }
63
+ end
64
+
65
+ desc 'Restart sneakers'
66
+ task restart: :environment do
67
+ comment 'Restart sneakers...'
68
+ invoke :'sneakers:stop'
69
+ invoke :'sneakers:start'
70
+ end
71
+
72
+ desc 'Restart sneakers (phased restart). Auto Scaling support'
73
+ task phased_restart: :environment do
74
+ comment 'Phased restart sneakers... '
75
+ command %{
76
+ if [ -e "#{fetch(:sneakers_pid)}" ]; then
77
+ if [ -e /proc/$(cat '#{fetch(:sneakers_pid)}') ]; then
78
+ kill -SIGUSR2 `cat #{fetch(:sneakers_pid)}` && kill -SIGUSR1 `cat #{fetch(:sneakers_pid)}`
79
+ else
80
+ echo 'Sneakers stopped!';
81
+ fi
82
+ else
83
+ echo 'Sneakers is not running!';
84
+ fi
85
+ }
86
+ end
87
+ end
@@ -0,0 +1,5 @@
1
+ module Mina
2
+ module Sneakers
3
+ VERSION = '0.1'.freeze
4
+ end
5
+ end
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'mina/sneakers/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'mina-sneakers'
8
+ spec.version = Mina::Sneakers::VERSION
9
+ spec.authors = ['Vladimir Sharshov']
10
+ spec.email = ['vsharshov@gmail.com']
11
+ spec.description = 'Sneakers tasks for Mina'
12
+ spec.summary = 'Sneakers tasks for Mina'
13
+ spec.homepage = 'https://github.com/warpc/mina-sneakers'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_dependency 'mina', '~> 1.0'
22
+ spec.add_dependency 'sneakers', '~> 2.6'
23
+
24
+ spec.add_development_dependency 'bundler', '~> 1.3'
25
+ spec.add_development_dependency 'rake'
26
+ end
metadata ADDED
@@ -0,0 +1,109 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: mina-sneakers
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.1'
5
+ platform: ruby
6
+ authors:
7
+ - Vladimir Sharshov
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-09-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: mina
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: sneakers
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.6'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.6'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.3'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.3'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: Sneakers tasks for Mina
70
+ email:
71
+ - vsharshov@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - Gemfile
78
+ - LICENSE
79
+ - README.md
80
+ - Rakefile
81
+ - lib/mina/sneakers.rb
82
+ - lib/mina/sneakers/tasks.rake
83
+ - lib/mina/sneakers/version.rb
84
+ - mina-sneakers.gemspec
85
+ homepage: https://github.com/warpc/mina-sneakers
86
+ licenses:
87
+ - MIT
88
+ metadata: {}
89
+ post_install_message:
90
+ rdoc_options: []
91
+ require_paths:
92
+ - lib
93
+ required_ruby_version: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ required_rubygems_version: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ requirements: []
104
+ rubyforge_project:
105
+ rubygems_version: 2.6.12
106
+ signing_key:
107
+ specification_version: 4
108
+ summary: Sneakers tasks for Mina
109
+ test_files: []