freshlime_deploy 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ source "http://rubygems.org"
2
+ # Add dependencies required to use your gem here.
3
+ # Example:
4
+ gem "capistrano", ">= 2.5.19"
5
+ gem "capistrano-ext", ">= 1.2.1"
6
+
7
+ # Add dependencies to develop your gem here.
8
+ # Include everything needed to run rake, tests, features, etc.
9
+ group :development do
10
+ gem "shoulda", ">= 0"
11
+ gem "bundler", "~> 1.0.0"
12
+ gem "jeweler", "~> 1.5.2"
13
+ gem "rcov", ">= 0"
14
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,38 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ capistrano (2.5.19)
5
+ highline
6
+ net-scp (>= 1.0.0)
7
+ net-sftp (>= 2.0.0)
8
+ net-ssh (>= 2.0.14)
9
+ net-ssh-gateway (>= 1.0.0)
10
+ capistrano-ext (1.2.1)
11
+ capistrano (>= 1.0.0)
12
+ git (1.2.5)
13
+ highline (1.6.1)
14
+ jeweler (1.5.2)
15
+ bundler (~> 1.0.0)
16
+ git (>= 1.2.5)
17
+ rake
18
+ net-scp (1.0.4)
19
+ net-ssh (>= 1.99.1)
20
+ net-sftp (2.0.5)
21
+ net-ssh (>= 2.0.9)
22
+ net-ssh (2.1.0)
23
+ net-ssh-gateway (1.0.1)
24
+ net-ssh (>= 1.99.1)
25
+ rake (0.8.7)
26
+ rcov (0.9.9)
27
+ shoulda (2.11.3)
28
+
29
+ PLATFORMS
30
+ ruby
31
+
32
+ DEPENDENCIES
33
+ bundler (~> 1.0.0)
34
+ capistrano (>= 2.5.19)
35
+ capistrano-ext (>= 1.2.1)
36
+ jeweler (~> 1.5.2)
37
+ rcov
38
+ shoulda
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 Andrey Voronov
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,19 @@
1
+ = freshlime-deploy
2
+
3
+ Description goes here.
4
+
5
+ == Contributing to freshlime-deploy
6
+
7
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
8
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
9
+ * Fork the project
10
+ * Start a feature/bugfix branch
11
+ * Commit and push until you are happy with your contribution
12
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
+
15
+ == Copyright
16
+
17
+ Copyright (c) 2011 Andrey Voronov. See LICENSE.txt for
18
+ further details.
19
+
data/Rakefile ADDED
@@ -0,0 +1,54 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ begin
4
+ Bundler.setup(:default, :development)
5
+ rescue Bundler::BundlerError => e
6
+ $stderr.puts e.message
7
+ $stderr.puts "Run `bundle install` to install missing gems"
8
+ exit e.status_code
9
+ end
10
+ require 'rake'
11
+
12
+ require 'jeweler'
13
+ Jeweler::Tasks.new do |gem|
14
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
15
+ gem.name = "freshlime_deploy"
16
+ gem.homepage = "http://github.com/voronov/freshlime-deploy"
17
+ gem.license = "MIT"
18
+ gem.summary = %Q{specific recipe for freshlimestudio rails deployment}
19
+ gem.description = %Q{specific recipe for freshlimestudio deployment}
20
+ gem.email = "andreyv@freshlimestudio.com"
21
+ gem.authors = ["Andrey Voronov"]
22
+ # Include your dependencies below. Runtime dependencies are required when using your gem,
23
+ # and development dependencies are only needed for development (ie running rake tasks, tests, etc)
24
+ gem.add_runtime_dependency 'capistrano', '>= 2.5.19'
25
+ gem.add_runtime_dependency 'capistrano-ext', '>= 1.2.1'
26
+ #gem.add_development_dependency 'rspec', '> 1.2.3'
27
+ end
28
+ Jeweler::RubygemsDotOrgTasks.new
29
+
30
+ require 'rake/testtask'
31
+ Rake::TestTask.new(:test) do |test|
32
+ test.libs << 'lib' << 'test'
33
+ test.pattern = 'test/**/test_*.rb'
34
+ test.verbose = true
35
+ end
36
+
37
+ require 'rcov/rcovtask'
38
+ Rcov::RcovTask.new do |test|
39
+ test.libs << 'test'
40
+ test.pattern = 'test/**/test_*.rb'
41
+ test.verbose = true
42
+ end
43
+
44
+ task :default => :test
45
+
46
+ require 'rake/rdoctask'
47
+ Rake::RDocTask.new do |rdoc|
48
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
49
+
50
+ rdoc.rdoc_dir = 'rdoc'
51
+ rdoc.title = "freshlime-deploy #{version}"
52
+ rdoc.rdoc_files.include('README*')
53
+ rdoc.rdoc_files.include('lib/**/*.rb')
54
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
@@ -0,0 +1,76 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{freshlime_deploy}
8
+ s.version = "0.1.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Andrey Voronov"]
12
+ s.date = %q{2011-03-21}
13
+ s.description = %q{specific recipe for freshlimestudio deployment}
14
+ s.email = %q{andreyv@freshlimestudio.com}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE.txt",
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ "Gemfile",
22
+ "Gemfile.lock",
23
+ "LICENSE.txt",
24
+ "README.rdoc",
25
+ "Rakefile",
26
+ "VERSION",
27
+ "freshlime_deploy.gemspec",
28
+ "lib/freshlime_deploy.rb",
29
+ "lib/freshlime_deploy/recipe.rb",
30
+ "test/helper.rb",
31
+ "test/test_freshlime_deploy.rb"
32
+ ]
33
+ s.homepage = %q{http://github.com/voronov/freshlime-deploy}
34
+ s.licenses = ["MIT"]
35
+ s.require_paths = ["lib"]
36
+ s.rubygems_version = %q{1.6.2}
37
+ s.summary = %q{specific recipe for freshlimestudio rails deployment}
38
+ s.test_files = [
39
+ "test/helper.rb",
40
+ "test/test_freshlime_deploy.rb"
41
+ ]
42
+
43
+ if s.respond_to? :specification_version then
44
+ s.specification_version = 3
45
+
46
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
47
+ s.add_runtime_dependency(%q<capistrano>, [">= 2.5.19"])
48
+ s.add_runtime_dependency(%q<capistrano-ext>, [">= 1.2.1"])
49
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
50
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
51
+ s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
52
+ s.add_development_dependency(%q<rcov>, [">= 0"])
53
+ s.add_runtime_dependency(%q<capistrano>, [">= 2.5.19"])
54
+ s.add_runtime_dependency(%q<capistrano-ext>, [">= 1.2.1"])
55
+ else
56
+ s.add_dependency(%q<capistrano>, [">= 2.5.19"])
57
+ s.add_dependency(%q<capistrano-ext>, [">= 1.2.1"])
58
+ s.add_dependency(%q<shoulda>, [">= 0"])
59
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
60
+ s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
61
+ s.add_dependency(%q<rcov>, [">= 0"])
62
+ s.add_dependency(%q<capistrano>, [">= 2.5.19"])
63
+ s.add_dependency(%q<capistrano-ext>, [">= 1.2.1"])
64
+ end
65
+ else
66
+ s.add_dependency(%q<capistrano>, [">= 2.5.19"])
67
+ s.add_dependency(%q<capistrano-ext>, [">= 1.2.1"])
68
+ s.add_dependency(%q<shoulda>, [">= 0"])
69
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
70
+ s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
71
+ s.add_dependency(%q<rcov>, [">= 0"])
72
+ s.add_dependency(%q<capistrano>, [">= 2.5.19"])
73
+ s.add_dependency(%q<capistrano-ext>, [">= 1.2.1"])
74
+ end
75
+ end
76
+
@@ -0,0 +1,71 @@
1
+ Capistrano::Configuration.instance.load do
2
+ require 'capistrano/ext/multistage'
3
+ require 'bundler/capistrano'
4
+
5
+ set :use_sudo, false
6
+ set :stages, %w(prod dev)
7
+ set :deploy_via, :remote_cache
8
+ set :default_stage, "dev"
9
+ set :keep_releases, 5
10
+
11
+ set :shared_children, fetch(:shared_children) + %w(public/assets assets config)
12
+
13
+ default_run_options[:pty] = true
14
+ ssh_options[:forward_agent] = true
15
+
16
+ set :rake, "rake"
17
+ set :rails_env, "production"
18
+ set :migrate_env, ""
19
+ set :migrate_target, :current
20
+
21
+ namespace :deploy do
22
+
23
+ desc "Tail log file"
24
+ task :tail_logs, :roles => :app do
25
+ run "tail -f #{shared_path}/log/production.log" do |channel, stream, data|
26
+ puts # for an extra line break before the host name
27
+ puts "#{channel[:host]}: #{data}"
28
+ break if stream == :err
29
+ end
30
+ end
31
+
32
+ desc "Restart Application"
33
+ task :restart, :roles => :app do
34
+ run "touch #{current_release}/tmp/restart.txt"
35
+ end
36
+
37
+ end
38
+
39
+ namespace :uploads do
40
+
41
+ desc "Creates the upload folders unless they exist and sets the proper upload permissions."
42
+ task :setup, :except => { :no_release => true } do
43
+ dirs = uploads_dirs.map { |d| File.join(shared_path, d) }
44
+ run "mkdir -p #{dirs.join(' ')} && chmod g+w #{dirs.join(' ')}"
45
+ end
46
+
47
+ desc "[internal] Creates the symlink to uploads shared folder for the most recently deployed version."
48
+ task :symlink, :except => { :no_release => true } do
49
+ run "rm -rf #{release_path}/assets"
50
+ run "rm -rf #{release_path}/public/assets"
51
+ run "ln -nfs #{shared_path}/public/assets #{release_path}/public/assets"
52
+ run "ln -nfs #{shared_path}/assets #{release_path}/assets"
53
+ end
54
+
55
+ desc "[internal] Computes uploads directory paths and registers them in Capistrano environment."
56
+ task :register_dirs do
57
+ set :uploads_dirs, %w( assets public/assets config )
58
+ set :shared_children, fetch(:shared_children) + fetch(:uploads_dirs)
59
+ end
60
+
61
+ after "deploy:update_code" do
62
+ run "ln -nfs #{deploy_to}/#{shared_dir}/config/database.yml #{release_path}/config/database.yml"
63
+ end
64
+
65
+ after "deploy:setup", "uploads:register_dirs", "uploads:setup"
66
+ after "deploy:finalize_update", "uploads:symlink"
67
+ after "deploy", "deploy:cleanup"
68
+ after "deploy:migrations", "deploy:cleanup"
69
+
70
+ end
71
+ end
File without changes
data/test/helper.rb ADDED
@@ -0,0 +1,18 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ begin
4
+ Bundler.setup(:default, :development)
5
+ rescue Bundler::BundlerError => e
6
+ $stderr.puts e.message
7
+ $stderr.puts "Run `bundle install` to install missing gems"
8
+ exit e.status_code
9
+ end
10
+ require 'test/unit'
11
+ require 'shoulda'
12
+
13
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
14
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
15
+ require 'freshlime_deploy'
16
+
17
+ class Test::Unit::TestCase
18
+ end
@@ -0,0 +1,7 @@
1
+ require 'helper'
2
+
3
+ class TestFreshlimeDeploy < Test::Unit::TestCase
4
+ should "probably rename this file and start testing for real" do
5
+ flunk "hey buddy, you should probably rename this file and start testing for real"
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,203 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: freshlime_deploy
3
+ version: !ruby/object:Gem::Version
4
+ hash: 27
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 0
10
+ version: 0.1.0
11
+ platform: ruby
12
+ authors:
13
+ - Andrey Voronov
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-03-21 00:00:00 +02:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ type: :runtime
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 61
29
+ segments:
30
+ - 2
31
+ - 5
32
+ - 19
33
+ version: 2.5.19
34
+ name: capistrano
35
+ version_requirements: *id001
36
+ prerelease: false
37
+ - !ruby/object:Gem::Dependency
38
+ type: :runtime
39
+ requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ hash: 29
45
+ segments:
46
+ - 1
47
+ - 2
48
+ - 1
49
+ version: 1.2.1
50
+ name: capistrano-ext
51
+ version_requirements: *id002
52
+ prerelease: false
53
+ - !ruby/object:Gem::Dependency
54
+ type: :development
55
+ requirement: &id003 !ruby/object:Gem::Requirement
56
+ none: false
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ hash: 3
61
+ segments:
62
+ - 0
63
+ version: "0"
64
+ name: shoulda
65
+ version_requirements: *id003
66
+ prerelease: false
67
+ - !ruby/object:Gem::Dependency
68
+ type: :development
69
+ requirement: &id004 !ruby/object:Gem::Requirement
70
+ none: false
71
+ requirements:
72
+ - - ~>
73
+ - !ruby/object:Gem::Version
74
+ hash: 23
75
+ segments:
76
+ - 1
77
+ - 0
78
+ - 0
79
+ version: 1.0.0
80
+ name: bundler
81
+ version_requirements: *id004
82
+ prerelease: false
83
+ - !ruby/object:Gem::Dependency
84
+ type: :development
85
+ requirement: &id005 !ruby/object:Gem::Requirement
86
+ none: false
87
+ requirements:
88
+ - - ~>
89
+ - !ruby/object:Gem::Version
90
+ hash: 7
91
+ segments:
92
+ - 1
93
+ - 5
94
+ - 2
95
+ version: 1.5.2
96
+ name: jeweler
97
+ version_requirements: *id005
98
+ prerelease: false
99
+ - !ruby/object:Gem::Dependency
100
+ type: :development
101
+ requirement: &id006 !ruby/object:Gem::Requirement
102
+ none: false
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ hash: 3
107
+ segments:
108
+ - 0
109
+ version: "0"
110
+ name: rcov
111
+ version_requirements: *id006
112
+ prerelease: false
113
+ - !ruby/object:Gem::Dependency
114
+ type: :runtime
115
+ requirement: &id007 !ruby/object:Gem::Requirement
116
+ none: false
117
+ requirements:
118
+ - - ">="
119
+ - !ruby/object:Gem::Version
120
+ hash: 61
121
+ segments:
122
+ - 2
123
+ - 5
124
+ - 19
125
+ version: 2.5.19
126
+ name: capistrano
127
+ version_requirements: *id007
128
+ prerelease: false
129
+ - !ruby/object:Gem::Dependency
130
+ type: :runtime
131
+ requirement: &id008 !ruby/object:Gem::Requirement
132
+ none: false
133
+ requirements:
134
+ - - ">="
135
+ - !ruby/object:Gem::Version
136
+ hash: 29
137
+ segments:
138
+ - 1
139
+ - 2
140
+ - 1
141
+ version: 1.2.1
142
+ name: capistrano-ext
143
+ version_requirements: *id008
144
+ prerelease: false
145
+ description: specific recipe for freshlimestudio deployment
146
+ email: andreyv@freshlimestudio.com
147
+ executables: []
148
+
149
+ extensions: []
150
+
151
+ extra_rdoc_files:
152
+ - LICENSE.txt
153
+ - README.rdoc
154
+ files:
155
+ - .document
156
+ - Gemfile
157
+ - Gemfile.lock
158
+ - LICENSE.txt
159
+ - README.rdoc
160
+ - Rakefile
161
+ - VERSION
162
+ - freshlime_deploy.gemspec
163
+ - lib/freshlime_deploy.rb
164
+ - lib/freshlime_deploy/recipe.rb
165
+ - test/helper.rb
166
+ - test/test_freshlime_deploy.rb
167
+ has_rdoc: true
168
+ homepage: http://github.com/voronov/freshlime-deploy
169
+ licenses:
170
+ - MIT
171
+ post_install_message:
172
+ rdoc_options: []
173
+
174
+ require_paths:
175
+ - lib
176
+ required_ruby_version: !ruby/object:Gem::Requirement
177
+ none: false
178
+ requirements:
179
+ - - ">="
180
+ - !ruby/object:Gem::Version
181
+ hash: 3
182
+ segments:
183
+ - 0
184
+ version: "0"
185
+ required_rubygems_version: !ruby/object:Gem::Requirement
186
+ none: false
187
+ requirements:
188
+ - - ">="
189
+ - !ruby/object:Gem::Version
190
+ hash: 3
191
+ segments:
192
+ - 0
193
+ version: "0"
194
+ requirements: []
195
+
196
+ rubyforge_project:
197
+ rubygems_version: 1.6.2
198
+ signing_key:
199
+ specification_version: 3
200
+ summary: specific recipe for freshlimestudio rails deployment
201
+ test_files:
202
+ - test/helper.rb
203
+ - test/test_freshlime_deploy.rb