capsum 1.0.0.alpha1 → 1.0.0.alpha2
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/LICENSE.txt +22 -0
- data/README.md +48 -21
- data/Rakefile +1 -27
- data/capsum.gemspec +26 -26
- data/lib/capsum.rb +1 -28
- data/lib/capsum/bundler.rb +1 -0
- data/lib/capsum/cache.rb +1 -1
- data/lib/capsum/daemons.rb +1 -2
- data/lib/capsum/foundation.rb +4 -3
- data/lib/capsum/git.rb +2 -2
- data/lib/capsum/passenger.rb +1 -1
- data/lib/capsum/shared.rb +2 -0
- data/lib/capsum/sidekiq.rb +10 -4
- data/lib/capsum/typical.rb +5 -6
- data/lib/capsum/version.rb +3 -0
- data/lib/capsum/whenever.rb +2 -2
- metadata +8 -21
- data/VERSION +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74da8e445fba62989f6994b4ea197629e62c1284
|
4
|
+
data.tar.gz: ed982fe0747c02d5ec3bb3ebf5c50c95ee50a501
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce7ea0e80e5dc76e4e0eff1b07c9578b4965d860915ffbb843991bd437089da0c3fc07d5cdf5fba91318245c4bd56da82815439876687aa23da37abdc502a2a9
|
7
|
+
data.tar.gz: b52e10c7c4b326c39ae0d815dd5742736400e299bcca62d889a6d4800e0ebb80894d8b958bd864f4139e5442c4fed4e0c3da67ed5079c4b424308a039a85eb44
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2010 sunteya
|
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.
|
data/README.md
CHANGED
@@ -1,32 +1,59 @@
|
|
1
|
-
|
1
|
+
# Capsum
|
2
2
|
|
3
|
-
|
4
|
-
load 'deploy' if respond_to?(:namespace)
|
5
|
-
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
|
6
|
-
load 'config/deploy'
|
7
|
-
load 'deploy/assets'
|
8
|
-
|
3
|
+
collect gems and recipes for capistrano.
|
9
4
|
|
5
|
+
## Installation
|
10
6
|
|
11
|
-
|
7
|
+
Add this line to your application's Gemfile:
|
12
8
|
|
13
|
-
|
14
|
-
|
15
|
-
set :application, "portal"
|
16
|
-
set :shared, %w{
|
17
|
-
config/database.yml
|
18
|
-
config/settings.local.yml
|
19
|
-
}
|
9
|
+
gem "capsum", require: false
|
20
10
|
|
11
|
+
## Usage
|
21
12
|
|
22
|
-
|
13
|
+
Add below files to your application.
|
23
14
|
|
24
|
-
|
25
|
-
|
26
|
-
set :user, "www-data"
|
27
|
-
server "foo.bar.com", :app, :web, :db, :primary => true
|
15
|
+
### ./Capfile
|
28
16
|
|
17
|
+
~~~~ruby
|
18
|
+
require 'capistrano/setup'
|
19
|
+
require 'capistrano/deploy'
|
29
20
|
|
30
|
-
|
21
|
+
require "capsum/typical" # for rails project
|
22
|
+
# require "capsum/sidekiq"
|
23
|
+
~~~~
|
24
|
+
|
25
|
+
### ./config/deploy.rb
|
26
|
+
|
27
|
+
~~~~ruby
|
28
|
+
set :application, 'shipin8'
|
29
|
+
|
30
|
+
# fetch(:linked_files).concat %w{
|
31
|
+
# config/database.yml
|
32
|
+
# config/settings.local.rb
|
33
|
+
# }
|
34
|
+
|
35
|
+
# fetch(:linked_dirs).concat %w{
|
36
|
+
# public/uploads
|
37
|
+
# }
|
38
|
+
~~~~
|
39
|
+
|
40
|
+
### ./config/deploy/uat.rb
|
41
|
+
|
42
|
+
~~~~ruby
|
43
|
+
set :deploy_to, -> { "/var/www/default/apps/#{fetch(:application)}" }
|
44
|
+
server 'host', user: 'www-data', roles: %w[web app db], primary: true # whenever: true, sidekiq: true
|
45
|
+
|
46
|
+
# bundle_env_variables[:http_proxy] = bundle_env_variables[:https_proxy] = "http://http_proxy_host:port"
|
47
|
+
~~~~
|
48
|
+
|
49
|
+
now, you can use below command to delpoy your application. for more information please see the source code.
|
31
50
|
|
32
51
|
cap uat deploy
|
52
|
+
|
53
|
+
## Contributing
|
54
|
+
|
55
|
+
1. Fork it ( https://github.com/sunteya/capsum/fork )
|
56
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
57
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
58
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
59
|
+
5. Create a new Pull Request
|
data/Rakefile
CHANGED
@@ -1,27 +1 @@
|
|
1
|
-
require
|
2
|
-
Bundler::GemHelper.install_tasks
|
3
|
-
|
4
|
-
require 'rake/version_task'
|
5
|
-
Rake::VersionTask.new
|
6
|
-
|
7
|
-
# require File.expand_path("../depends.rb", __FILE__)
|
8
|
-
# GemLoader.require(:rakefile)
|
9
|
-
#
|
10
|
-
#
|
11
|
-
# Spec::Rake::SpecTask.new(:spec) do |spec|
|
12
|
-
# spec.libs << 'lib' << 'spec'
|
13
|
-
# spec.spec_opts = ['--options', "spec/spec.opts"]
|
14
|
-
# spec.spec_files = FileList['spec/**/*_spec.rb']
|
15
|
-
# end
|
16
|
-
#
|
17
|
-
# namespace :spec do
|
18
|
-
# Spec::Rake::SpecTask.new(:rcov) do |spec|
|
19
|
-
# spec.libs << 'lib' << 'spec'
|
20
|
-
# spec.pattern = 'spec/**/*_spec.rb'
|
21
|
-
# spec.rcov = true
|
22
|
-
# end
|
23
|
-
# end
|
24
|
-
#
|
25
|
-
#
|
26
|
-
# task :spec => :check_dependencies
|
27
|
-
# task :default => :spec
|
1
|
+
require "bundler/gem_tasks"
|
data/capsum.gemspec
CHANGED
@@ -1,37 +1,37 @@
|
|
1
|
-
#
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'capsum/version'
|
2
5
|
|
3
|
-
Gem::Specification.new do |
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "capsum"
|
8
|
+
spec.version = Capsum::VERSION
|
9
|
+
spec.authors = ["sunteya"]
|
10
|
+
spec.email = ["sunteya@gmail.com"]
|
11
|
+
spec.summary = %q{Collect gems and recipes related capistrano.}
|
12
|
+
spec.description = %q{Collect gems and recipes related capistrano.}
|
13
|
+
spec.homepage = "http://github.com/sunteya/capsum"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
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"]
|
12
20
|
|
13
|
-
s.files = `git ls-files`.split("\n")
|
14
|
-
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
15
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
16
|
-
s.require_paths = ["lib"]
|
17
|
-
s.license = 'MIT'
|
18
|
-
|
19
21
|
# Dependency Gems
|
20
|
-
|
21
|
-
#
|
22
|
-
|
23
|
-
|
22
|
+
spec.add_dependency "capistrano", "~> 3.1"
|
23
|
+
# spec.add_dependency "capistrano-rsync", "~> 1.0.2" # broken, wait update
|
24
|
+
spec.add_dependency "capistrano-rails", "~> 1.1.1"
|
25
|
+
spec.add_development_dependency "capistrano-sidekiq", "~> 0.1.3" # optional
|
24
26
|
|
25
|
-
#
|
26
|
-
#
|
27
|
+
# spec.add_dependency "capistrano-helpers", "~> 0.7.1"
|
28
|
+
# spec.add_dependency "cap-recipes", "~> 0.3.36"
|
27
29
|
# https://github.com/rubaidh/rubaidhstrano
|
28
30
|
# https://github.com/relevance/cap_gun
|
29
31
|
# https://github.com/railsmachine/capistrano-cowboy
|
30
32
|
# https://github.com/fnichol/capstrap
|
31
33
|
# https://github.com/bokmann/dunce-cap
|
32
34
|
|
33
|
-
|
34
|
-
|
35
|
-
s.add_development_dependency "version"
|
35
|
+
spec.add_development_dependency "rake"
|
36
|
+
spec.add_development_dependency "bundler", ">= 1.6.1"
|
36
37
|
end
|
37
|
-
|
data/lib/capsum.rb
CHANGED
@@ -1,31 +1,4 @@
|
|
1
|
-
|
1
|
+
require "capsum/version"
|
2
2
|
|
3
3
|
module Capsum
|
4
|
-
VERSION = open(File.expand_path("../../VERSION", __FILE__)).read.chomp
|
5
4
|
end
|
6
|
-
|
7
|
-
# Capistrano::Configuration.instance(true).load do
|
8
|
-
|
9
|
-
# def self.unbefore(task_name, name)
|
10
|
-
# options = { :only => [ task_name ] }
|
11
|
-
# unon :before, name, options
|
12
|
-
# end
|
13
|
-
|
14
|
-
# def self.unafter(task_name, name)
|
15
|
-
# options = { :only => [ task_name ] }
|
16
|
-
# unon :after, name, options
|
17
|
-
# end
|
18
|
-
|
19
|
-
# def self.unon(event, name, options)
|
20
|
-
# self.callbacks[event].delete_if do |callback|
|
21
|
-
# do_delete = false
|
22
|
-
# if callback.respond_to?(:source)
|
23
|
-
# do_delete = (name == callback.source)
|
24
|
-
# do_delete &&= (options[:only] && options[:only] == callback.only)
|
25
|
-
# end
|
26
|
-
|
27
|
-
# do_delete
|
28
|
-
# end
|
29
|
-
# end
|
30
|
-
|
31
|
-
# end
|
data/lib/capsum/bundler.rb
CHANGED
data/lib/capsum/cache.rb
CHANGED
data/lib/capsum/daemons.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "capsum"
|
2
2
|
# require File.expand_path("../autostart.rb", __FILE__)
|
3
3
|
|
4
4
|
namespace :load do
|
@@ -8,7 +8,6 @@ namespace :load do
|
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
|
-
|
12
11
|
namespace :daemons do
|
13
12
|
task :prepare do
|
14
13
|
# TODO: covert daemons to daemon_list
|
data/lib/capsum/foundation.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
1
|
+
require "capsum"
|
2
|
+
require "capsum/git"
|
3
|
+
require "capsum/shared"
|
4
|
+
require "capistrano/console"
|
4
5
|
require "capistrano/rsync"
|
5
6
|
|
6
7
|
namespace :load do
|
data/lib/capsum/git.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
|
1
|
+
require "capsum"
|
2
2
|
|
3
3
|
namespace :load do
|
4
4
|
task :defaults do
|
5
5
|
# use current branch
|
6
6
|
set :branch, -> { `git describe --contains --all HEAD | tr -d '\n'` }
|
7
7
|
|
8
|
-
# use current remote
|
8
|
+
# use current remote repo url
|
9
9
|
set :repo_url, -> {
|
10
10
|
remote = `git config --get branch.#{fetch(:branch)}.remote | tr -d '\n'`
|
11
11
|
`git config --get remote.#{remote}.url | tr -d '\n'`
|
data/lib/capsum/passenger.rb
CHANGED
data/lib/capsum/shared.rb
CHANGED
data/lib/capsum/sidekiq.rb
CHANGED
@@ -1,13 +1,19 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
|
1
|
+
require "capsum"
|
2
|
+
require "capsum/daemons"
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'capistrano/sidekiq'
|
6
|
+
rescue LoadError
|
7
|
+
puts 'ERROR: If you want to use the "capsum/sidekiq". you must to add [ gem "capistrano-sidekiq", require: false ] to your Gemfile.'
|
8
|
+
exit 1
|
9
|
+
end
|
4
10
|
|
5
11
|
namespace :sidekiq do
|
6
12
|
task :update_daemon_list do
|
7
13
|
scripts = []
|
8
14
|
sidekiq_role = fetch(:sidekiq_role)
|
9
15
|
on (roles sidekiq_role || []).first do |host|
|
10
|
-
|
16
|
+
break if host.nil?
|
11
17
|
for_each_process do |pid_file, idx|
|
12
18
|
start_scripts = SimpleScriptRecord.new do
|
13
19
|
start_sidekiq(pid_file)
|
data/lib/capsum/typical.rb
CHANGED
@@ -1,11 +1,10 @@
|
|
1
|
-
require
|
2
|
-
|
3
|
-
require File.expand_path("../bundler.rb", __FILE__)
|
1
|
+
require "capsum/foundation"
|
2
|
+
require "capsum/bundler"
|
4
3
|
require 'capistrano/rails'
|
4
|
+
require "capsum/passenger"
|
5
|
+
require "capsum/whenever"
|
6
|
+
require "capsum/daemons.rb"
|
5
7
|
|
6
|
-
require File.expand_path("../passenger.rb", __FILE__)
|
7
|
-
require File.expand_path("../whenever.rb", __FILE__)
|
8
|
-
# require File.expand_path("../daemons.rb", __FILE__)
|
9
8
|
# require File.expand_path("../cache.rb", __FILE__)
|
10
9
|
|
11
10
|
namespace :load do
|
data/lib/capsum/whenever.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capsum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.alpha2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- sunteya
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
@@ -72,31 +72,17 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 1.6.1
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: version
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
82
|
+
version: 1.6.1
|
97
83
|
description: Collect gems and recipes related capistrano.
|
98
84
|
email:
|
99
|
-
-
|
85
|
+
- sunteya@gmail.com
|
100
86
|
executables: []
|
101
87
|
extensions: []
|
102
88
|
extra_rdoc_files: []
|
@@ -104,9 +90,9 @@ files:
|
|
104
90
|
- ".gitignore"
|
105
91
|
- CHANGELOG.md
|
106
92
|
- Gemfile
|
93
|
+
- LICENSE.txt
|
107
94
|
- README.md
|
108
95
|
- Rakefile
|
109
|
-
- VERSION
|
110
96
|
- capsum.gemspec
|
111
97
|
- lib/capistrano/rsync.rb
|
112
98
|
- lib/capsum.rb
|
@@ -120,6 +106,7 @@ files:
|
|
120
106
|
- lib/capsum/shared.rb
|
121
107
|
- lib/capsum/sidekiq.rb
|
122
108
|
- lib/capsum/typical.rb
|
109
|
+
- lib/capsum/version.rb
|
123
110
|
- lib/capsum/whenever.rb
|
124
111
|
homepage: http://github.com/sunteya/capsum
|
125
112
|
licenses:
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
1.0.0.alpha1
|