techbang-capistrano 0.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 +15 -0
- data/.gitignore +17 -0
- data/Gemfile +3 -0
- data/LICENSE.md +22 -0
- data/README.md +35 -0
- data/Rakefile +1 -0
- data/lib/techbang/capistrano/version.rb +5 -0
- data/lib/techbang/capistrano.rb +68 -0
- data/techbang-capistrano.gemspec +23 -0
- metadata +80 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
Yjk3ZThhYmYwYjdmOTUxNDA2N2Y2MzY5YTk3OWRlYzJjOTI3ZDRkYg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NmJiZDhkOGYwMGM4MmJjYWIzYThhNjFlZjc5ZDU3NWQ5ZjhiOGYyMA==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
YmUzY2I1MTlmOTg0MDMwNDJkNjIyOGM1YTJlZjExYTk4MmY3MzY4YzJiYmJm
|
10
|
+
NWM1ZDBjMjNjNDM2MmYzMmM3ZjdkZDAwMGQ4MTkwZDg4ODU0MDMwYjI2YjA2
|
11
|
+
MTc0Y2JhOGNmZmYyN2QxZWM3OTJmZjExNTRlZTRmM2MwYjY3NDY=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MTQ5ODEyYzI2ZjNiYjIwNDkyY2Q3ODNlYzYzZmE1MzJlZWE0MWFiZTc5ZWYx
|
14
|
+
NjkxNzQ4Y2M5NjdiYzUzZmUyZmQ1ZDcxOGVlM2RhM2MzMTNkYzkzOGEwYjFm
|
15
|
+
NGQ5NzQyZTgwMDQxNmIyYTE4YjIwMzY0YTFlMjQ3ZmM5NTgwYzI=
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Techbang, http://www.techbang.com/
|
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
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# Techbang::Capistrano
|
2
|
+
|
3
|
+
Capistrano recipes for Techbang.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's `Gemfile`:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
group :development do
|
11
|
+
gem 'techbang-capistrano', :require => false
|
12
|
+
end
|
13
|
+
```
|
14
|
+
|
15
|
+
## Usage
|
16
|
+
|
17
|
+
In `config/deploy.rb`:
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
require 'techbang/capistrano'
|
21
|
+
```
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create new Pull Request
|
30
|
+
|
31
|
+
## License
|
32
|
+
|
33
|
+
Copyright (c) 2013 Techbang, http://www.techbang.com/. See [LICENSE][] for details.
|
34
|
+
|
35
|
+
[license]: LICENSE.md
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,68 @@
|
|
1
|
+
require "techbang/capistrano/version"
|
2
|
+
|
3
|
+
module Techbang
|
4
|
+
module Capistrano
|
5
|
+
def self.load_into(configuration)
|
6
|
+
configuration.load do
|
7
|
+
|
8
|
+
# Overrides deploy:assets:precompile task of Capistrano
|
9
|
+
#
|
10
|
+
# It was originally taken from:
|
11
|
+
# https://github.com/AF83/capistrano-af83/blob/master/lib/capistrano/af83/deploy/assets.rb
|
12
|
+
#
|
13
|
+
set :assets_dependencies, %w(app/assets lib/assets vendor/assets Gemfile.lock config/routes.rb)
|
14
|
+
|
15
|
+
namespace :deploy do
|
16
|
+
namespace :assets do
|
17
|
+
|
18
|
+
desc <<-DESC
|
19
|
+
Run the asset precompilation rake task. You can specify the full path \
|
20
|
+
to the rake executable by setting the rake variable. You can also \
|
21
|
+
specify additional environment variables to pass to rake via the \
|
22
|
+
asset_env variable. The defaults are:
|
23
|
+
|
24
|
+
set :rake, "rake"
|
25
|
+
set :rails_env, "production"
|
26
|
+
set :asset_env, "RAILS_GROUPS=assets"
|
27
|
+
set :assets_dependencies, fetch(:assets_dependencies) + %w(config/locales/js)
|
28
|
+
DESC
|
29
|
+
task :precompile, :roles => lambda { assets_role }, :except => { :no_release => true } do
|
30
|
+
from = source.next_revision(current_revision)
|
31
|
+
if capture("cd #{latest_release} && #{source.local.diff(from)} -- #{assets_dependencies.join ' '} | wc -l").to_i > 0
|
32
|
+
run %Q{cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile:primary}
|
33
|
+
else
|
34
|
+
logger.info "Skipping asset pre-compilation because there were no asset changes"
|
35
|
+
end
|
36
|
+
|
37
|
+
#
|
38
|
+
# The following was taken from Capistrano.
|
39
|
+
#
|
40
|
+
|
41
|
+
if capture("ls -1 #{shared_path.shellescape}/#{shared_assets_prefix}/manifest* | wc -l").to_i > 1
|
42
|
+
raise "More than one asset manifest file was found in '#{shared_path.shellescape}/#{shared_assets_prefix}'. If you are upgrading a Rails 3 application to Rails 4, follow these instructions: http://github.com/capistrano/capistrano/wiki/Upgrading-to-Rails-4#asset-pipeline"
|
43
|
+
end
|
44
|
+
|
45
|
+
# Sync manifest filenames across servers if our manifest has a random filename
|
46
|
+
if shared_manifest_path =~ /manifest-.+\./
|
47
|
+
run <<-CMD.compact
|
48
|
+
[ -e #{shared_manifest_path.shellescape} ] || mv -- #{shared_path.shellescape}/#{shared_assets_prefix}/manifest* #{shared_manifest_path.shellescape}
|
49
|
+
CMD
|
50
|
+
end
|
51
|
+
|
52
|
+
# Copy manifest to release root (for clean_expired task)
|
53
|
+
run <<-CMD.compact
|
54
|
+
cp -- #{shared_manifest_path.shellescape} #{current_release.to_s.shellescape}/assets_manifest#{File.extname(shared_manifest_path)}
|
55
|
+
CMD
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
if Capistrano::Configuration.instance
|
67
|
+
Techbang::Capistrano.load_into(Capistrano::Configuration.instance)
|
68
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'techbang/capistrano/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "techbang-capistrano"
|
8
|
+
spec.version = Techbang::Capistrano::VERSION
|
9
|
+
spec.authors = ["Techbang"]
|
10
|
+
spec.email = ["tech@techbang.com.tw"]
|
11
|
+
spec.description = "Capistrano recipes for Techbang."
|
12
|
+
spec.summary = "Capistrano recipes for Techbang."
|
13
|
+
spec.homepage = "https://github.com/techbang/techbang-capistrano"
|
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_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: techbang-capistrano
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Techbang
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-05-22 00:00:00.000000000 Z
|
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.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
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
|
+
description: Capistrano recipes for Techbang.
|
42
|
+
email:
|
43
|
+
- tech@techbang.com.tw
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- .gitignore
|
49
|
+
- Gemfile
|
50
|
+
- LICENSE.md
|
51
|
+
- README.md
|
52
|
+
- Rakefile
|
53
|
+
- lib/techbang/capistrano.rb
|
54
|
+
- lib/techbang/capistrano/version.rb
|
55
|
+
- techbang-capistrano.gemspec
|
56
|
+
homepage: https://github.com/techbang/techbang-capistrano
|
57
|
+
licenses:
|
58
|
+
- MIT
|
59
|
+
metadata: {}
|
60
|
+
post_install_message:
|
61
|
+
rdoc_options: []
|
62
|
+
require_paths:
|
63
|
+
- lib
|
64
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ! '>='
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
requirements: []
|
75
|
+
rubyforge_project:
|
76
|
+
rubygems_version: 2.0.3
|
77
|
+
signing_key:
|
78
|
+
specification_version: 4
|
79
|
+
summary: Capistrano recipes for Techbang.
|
80
|
+
test_files: []
|