capistrano-server-plug 0.0.2.beta.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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0a872eb00516499d6e883d9911fdbb741e52f13a
4
+ data.tar.gz: 091de909de25018dd0b9c2d7728935e1dab2caef
5
+ SHA512:
6
+ metadata.gz: 164cd11dd87067012640ee4ee1785ce26661f06d3c15ac823cafdf4ad4c996f5a35b7ab4194b259b84a0dab3ad13344a43c94c06213de0b9ffbb3a5bdf569d34
7
+ data.tar.gz: 11e0a22e748067e92928213cfa9e6c2223b507af3bed3d7b237f83763ee9112ae97de0a7f28934b211421f8023afdb8184ca7544696172954ed233f53ac5daad
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in capistrano-server-plug.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Elia Schito
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,41 @@
1
+ # Capistrano::Server::Plug
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'capistrano-server-plug'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install capistrano-server-plug
18
+
19
+ ## Usage
20
+
21
+ inside `config/deploy.rb`
22
+
23
+ ```ruby
24
+ require 'capistrano/server/plug'
25
+ ```
26
+
27
+ inside `config/deploy/<my-stage>.rb`
28
+
29
+ ```ruby
30
+ set :server_type, :passenger
31
+ ```
32
+
33
+
34
+
35
+ ## Contributing
36
+
37
+ 1. Fork it
38
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
39
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
40
+ 4. Push to the branch (`git push origin my-new-feature`)
41
+ 5. Create new Pull Request
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'capistrano/server/plug/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'capistrano-server-plug'
8
+ spec.version = Capistrano::Server::Plug::VERSION
9
+ spec.authors = ['Elia Schito']
10
+ spec.email = ['elia@schito.me']
11
+ spec.description = %q{Make the deploy server a simple capistrano setting}
12
+ spec.summary = %q{Make the deploy server a simple capistrano setting}
13
+ spec.homepage = 'https://github.com/elia/capistrano-server-plug#readme'
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_runtime_dependency 'capistrano', ['~> 2.15', '>= 2.15.5']
22
+
23
+ spec.add_development_dependency 'bundler', '~> 1.3'
24
+ spec.add_development_dependency 'rake'
25
+ end
@@ -0,0 +1,73 @@
1
+ require 'capistrano/server/plug/version'
2
+ require 'capistrano'
3
+
4
+ module Capistrano
5
+ module Server
6
+ module Plug
7
+
8
+ Configuration.instance(true).load do
9
+ namespace :deploy do
10
+ task(:start) { send(server_type).start }
11
+ task(:stop) { send(server_type).stop }
12
+ task(:restart) { send(server_type).restart }
13
+ task(:status) { send(server_type).status }
14
+ end
15
+
16
+
17
+ namespace :torquebox do
18
+ task :start do
19
+ default_environment['JRUBY_OPTIONS'] = fetch(:jruby_options, nil)
20
+ screen_name = "griglione_torquebox_#{deploy_env}"
21
+ run %Q{#{jruby_options} cd #{current_path} && screen -dmS "#{screen_name}" bundle exec torquebox run -b #{server_host} -p #{web_port}}
22
+ run %Q{screen -list | grep #{screen_name}}
23
+ end
24
+ end
25
+
26
+ namespace :passenger do
27
+ task :start do
28
+ #noop
29
+ end
30
+
31
+ task :stop do
32
+ #noop
33
+ end
34
+
35
+ task :restart do
36
+ run %Q{touch "#{current_path}/tmp/restart.txt"}
37
+ end
38
+
39
+ task :status do
40
+ #noop
41
+ end
42
+ end
43
+
44
+ namespace :thin do
45
+ set(:pid_path) { "#{current_path}/tmp/pids/server.pid" }
46
+ set(:pid) { "$(cat #{pid_path})" }
47
+
48
+ task :start do
49
+ run "cd #{current_path} && ./script/rails server --port=#{web_port} --environment=#{deploy_env} --daemon"
50
+ end
51
+
52
+ task :stop do
53
+ run "test -f #{pid_path} && kill -s TERM $(cat #{pid_path}) || true"
54
+ run "while test -f #{pid_path}; do sleep 1; echo 'waiting for termination pid $(cat #{pid_path}) and for deletion of #{pid_path}...'; done"
55
+ end
56
+
57
+ task :restart do
58
+ deploy.stop
59
+ deploy.start
60
+ end
61
+
62
+
63
+ # SERVER STATUS
64
+
65
+ task :status do
66
+ run "ps u -p #{pid}"
67
+ end
68
+ end
69
+ end
70
+
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,7 @@
1
+ module Capistrano
2
+ module Server
3
+ module Plug
4
+ VERSION = "0.0.2.beta.1"
5
+ end
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,100 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-server-plug
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2.beta.1
5
+ platform: ruby
6
+ authors:
7
+ - Elia Schito
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-08-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: capistrano
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '2.15'
20
+ - - '>='
21
+ - !ruby/object:Gem::Version
22
+ version: 2.15.5
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '2.15'
30
+ - - '>='
31
+ - !ruby/object:Gem::Version
32
+ version: 2.15.5
33
+ - !ruby/object:Gem::Dependency
34
+ name: bundler
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ~>
38
+ - !ruby/object:Gem::Version
39
+ version: '1.3'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ~>
45
+ - !ruby/object:Gem::Version
46
+ version: '1.3'
47
+ - !ruby/object:Gem::Dependency
48
+ name: rake
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - '>='
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ description: Make the deploy server a simple capistrano setting
62
+ email:
63
+ - elia@schito.me
64
+ executables: []
65
+ extensions: []
66
+ extra_rdoc_files: []
67
+ files:
68
+ - .gitignore
69
+ - Gemfile
70
+ - LICENSE.txt
71
+ - README.md
72
+ - Rakefile
73
+ - capistrano-server-plug.gemspec
74
+ - lib/capistrano/server/plug.rb
75
+ - lib/capistrano/server/plug/version.rb
76
+ homepage: https://github.com/elia/capistrano-server-plug#readme
77
+ licenses:
78
+ - MIT
79
+ metadata: {}
80
+ post_install_message:
81
+ rdoc_options: []
82
+ require_paths:
83
+ - lib
84
+ required_ruby_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - '>='
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ required_rubygems_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - '>'
92
+ - !ruby/object:Gem::Version
93
+ version: 1.3.1
94
+ requirements: []
95
+ rubyforge_project:
96
+ rubygems_version: 2.0.3
97
+ signing_key:
98
+ specification_version: 4
99
+ summary: Make the deploy server a simple capistrano setting
100
+ test_files: []