symlink_fast 1.0.0

This diff has not been reviewed by any users.
Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in symlink_fast.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright (c) 2012 Spike Grobstein
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,25 @@
1
+ # SymlinkFast
2
+
3
+ SymlinkFast is a Capistrano plugin for doing post-deploy symlinking of your yaml files in a single `run` cycle rather than iterating over each config file individually.
4
+
5
+ On large deployments with a large number of configs, this can save significant overhead to the deploy time.
6
+
7
+ ## Example Usage
8
+
9
+ require "symlink_fast/capistrano"
10
+
11
+ set :symlink_configs, [ :database, :redis, :aws ]
12
+
13
+ SymlinkFast will add a post-deploy hook to symlink your config files.
14
+
15
+ All files must live in `#{deploy_to}/shared/config` and each item in the `configs` array is assumed to be the basename of each config file. For example, `:aws` will symlink the `aws.yml` file and so on.
16
+
17
+ ## Author
18
+
19
+ Spike Grobstein
20
+ spikegrobstein@mac.com
21
+ https://github.com/spikegrobstein
22
+
23
+ ## License
24
+
25
+ MIT License
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,21 @@
1
+ require "symlink_fast/version"
2
+
3
+ module SymlinkFast
4
+
5
+ class << self
6
+ attr_accessor :configs_path
7
+ attr_accessor :release_path
8
+ attr_accessor :shared_path
9
+ end
10
+
11
+ def self.command( configs )
12
+ configs.map do |config|
13
+ symlink config
14
+ end.join(' && ')
15
+ end
16
+
17
+ def self.symlink( config )
18
+ "ln -s '#{ configs_path }/#{ config }.yml' '#{ release_path }/config/'"
19
+ end
20
+
21
+ end
@@ -0,0 +1,26 @@
1
+ require 'symlink_fast'
2
+
3
+ Capistrano::Configuration.instance.load do
4
+
5
+ on :load do
6
+ find_and_execute_task('symlink_fast:init')
7
+ end
8
+
9
+ # we want to run the symlinking once the code is copied
10
+ # but before any code is run that might depend on the
11
+ # yaml files being in place.
12
+ after 'deploy:finalize_update', 'symlink_fast:default'
13
+
14
+ namespace :symlink_fast do
15
+ task :default, :except => { :no_release => true } do
16
+ run SymlinkFast::command( fetch(:symlink_configs, nil) )
17
+ end
18
+
19
+ task :init do
20
+ SymlinkFast.release_path = release_path
21
+ SymlinkFast.shared_path = shared_path
22
+ SymlinkFast.configs_path = "#{ shared_path }/config"
23
+ end
24
+ end
25
+
26
+ end
@@ -0,0 +1,3 @@
1
+ module SymlinkFast
2
+ VERSION = "1.0.0"
3
+ end
@@ -0,0 +1,21 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "symlink_fast/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "symlink_fast"
7
+ s.version = SymlinkFast::VERSION
8
+ s.authors = ["Spike Grobstein"]
9
+ s.email = ["spikegrobstein@mac.com"]
10
+ s.homepage = "https://github.com/spikegrobstein/capistrano-symlink_fast"
11
+ s.summary = %q{Fast Capistrano config symlinking}
12
+ s.description = %q{Symlink your configs in a single execution of run when deploying with Capistrano}
13
+
14
+ s.rubyforge_project = "symlink_fast"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+ s.add_dependency('capistrano', '>= 2.12.0')
21
+ end
metadata ADDED
@@ -0,0 +1,89 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: symlink_fast
3
+ version: !ruby/object:Gem::Version
4
+ hash: 23
5
+ prerelease:
6
+ segments:
7
+ - 1
8
+ - 0
9
+ - 0
10
+ version: 1.0.0
11
+ platform: ruby
12
+ authors:
13
+ - Spike Grobstein
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2012-05-16 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: capistrano
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 63
29
+ segments:
30
+ - 2
31
+ - 12
32
+ - 0
33
+ version: 2.12.0
34
+ type: :runtime
35
+ version_requirements: *id001
36
+ description: Symlink your configs in a single execution of run when deploying with Capistrano
37
+ email:
38
+ - spikegrobstein@mac.com
39
+ executables: []
40
+
41
+ extensions: []
42
+
43
+ extra_rdoc_files: []
44
+
45
+ files:
46
+ - .gitignore
47
+ - Gemfile
48
+ - LICENSE
49
+ - README.md
50
+ - Rakefile
51
+ - lib/symlink_fast.rb
52
+ - lib/symlink_fast/capistrano.rb
53
+ - lib/symlink_fast/version.rb
54
+ - symlink_fast.gemspec
55
+ homepage: https://github.com/spikegrobstein/capistrano-symlink_fast
56
+ licenses: []
57
+
58
+ post_install_message:
59
+ rdoc_options: []
60
+
61
+ require_paths:
62
+ - lib
63
+ required_ruby_version: !ruby/object:Gem::Requirement
64
+ none: false
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ hash: 3
69
+ segments:
70
+ - 0
71
+ version: "0"
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ hash: 3
78
+ segments:
79
+ - 0
80
+ version: "0"
81
+ requirements: []
82
+
83
+ rubyforge_project: symlink_fast
84
+ rubygems_version: 1.8.12
85
+ signing_key:
86
+ specification_version: 3
87
+ summary: Fast Capistrano config symlinking
88
+ test_files: []
89
+